l3uddz / plex_autoscan

Script to assist sonarr/radarr with plex imports. Will only scan the folder that has been imported, instead of the whole library section.
GNU General Public License v3.0
396 stars 70 forks source link

How does plex_autoscan deal with downtime? #90

Closed m1lkman closed 5 years ago

m1lkman commented 5 years ago

Wha happens when the system is offline or if rclone mount is down for a period of time? Will plex_autoscan catch up with changes since it last ran or do we need to take manual steps to have plex scan folders added/removed since it was last online?

desimaniac commented 5 years ago

New config option PLEX_CHECK_BEFORE_SCAN checks for Plex to be available before continuing.

Existing config options for file checks, check to see if file is available before proceeding.

PLEX_EMPTY_TRASH_CONTROL_FILES makes sure that it doesn't empty the trash when a mount goes offline.

m1lkman commented 5 years ago

@desimaniac PLEX_CHECK_BEFORE_SCAN sounds like it will help but what if plex_autoscan is not running for some time and files are both added and removed from gdrive. When plex_autoscan starts up again will it know about all changes since it last ran? Is this where SERVER_USE_SQLITE will help?

desimaniac commented 5 years ago

For instances where Plex was down, a file request came in, but that file was eventually removed:

PAS will attempt to check to see if the file exists (via SERVER_MAX_FILE_CHECKS SERVER_FILE_CHECK_DELAY) and if it cant find it, it will either skip or scan the entire season/movie folder depending on whether SERVER_SCAN_FOLDER_ON_FILE_EXISTS_EXHAUSTION is set to false or true, respectively.

There are a lot of details on the readme page, you should check that out first.