minutes between searches (minimum $sickbeard.MIN_BACKLOG_FREQUENCY)
+days between full backlog searches (min $sickbeard.MIN_BACKLOG_FREQUENCY, default $sickbeard.DEFAULT_BACKLOG_FREQUENCY, max $sickbeard.MAX_BACKLOG_FREQUENCY)
diff --git a/gui/slick/interfaces/default/inc_bottom.tmpl b/gui/slick/interfaces/default/inc_bottom.tmpl index e8fef222..abd697f6 100644 --- a/gui/slick/interfaces/default/inc_bottom.tmpl +++ b/gui/slick/interfaces/default/inc_bottom.tmpl @@ -62,6 +62,7 @@ %> / episodes downloaded $ep_percentage | recent search: | backlog search: + | full backlog: #slurp diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index d5c9879e..267d39bd 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -60,7 +60,7 @@ CFG = None CONFIG_FILE = None # This is the version of the config we EXPECT to find -CONFIG_VERSION = 9 +CONFIG_VERSION = 10 # Default encryption version (0 for None) ENCRYPTION_VERSION = 0 @@ -220,7 +220,8 @@ DEFAULT_UPDATE_FREQUENCY = 1 MIN_AUTOPOSTPROCESSER_FREQUENCY = 1 MIN_RECENTSEARCH_FREQUENCY = 10 -MIN_BACKLOG_FREQUENCY = 10 +MIN_BACKLOG_FREQUENCY = 2 +MAX_BACKLOG_FREQUENCY = 35 MIN_UPDATE_FREQUENCY = 1 BACKLOG_DAYS = 7 @@ -496,7 +497,7 @@ def initialize(consoleLogging=True): USE_KODI, KODI_ALWAYS_ON, KODI_NOTIFY_ONSNATCH, KODI_NOTIFY_ONDOWNLOAD, KODI_NOTIFY_ONSUBTITLEDOWNLOAD, KODI_UPDATE_FULL, KODI_UPDATE_ONLYFIRST, KODI_UPDATE_LIBRARY, KODI_HOST, KODI_USERNAME, KODI_PASSWORD, \ USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_USE_RECOMMENDED, TRAKT_SYNC, TRAKT_DEFAULT_INDEXER, TRAKT_REMOVE_SERIESLIST, \ USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \ - PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \ + PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, MAX_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \ showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, TRASH_REMOVE_SHOW, TRASH_ROTATE_LOGS, HOME_SEARCH_FOCUS, SORT_ARTICLE, showList, loadingShowList, UPDATE_SHOWS_ON_START, SHOW_UPDATE_HOUR, \ NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, INDEXER_DEFAULT, INDEXER_TIMEOUT, USENET_RETENTION, TORRENT_DIR, \ QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, WANTED_BEGIN_DEFAULT, WANTED_LATEST_DEFAULT, RECENTSEARCH_STARTUP, \ @@ -727,10 +728,8 @@ def initialize(consoleLogging=True): if RECENTSEARCH_FREQUENCY < MIN_RECENTSEARCH_FREQUENCY: RECENTSEARCH_FREQUENCY = MIN_RECENTSEARCH_FREQUENCY - MIN_BACKLOG_FREQUENCY = get_backlog_cycle_time() BACKLOG_FREQUENCY = check_setting_int(CFG, 'General', 'backlog_frequency', DEFAULT_BACKLOG_FREQUENCY) - if BACKLOG_FREQUENCY < MIN_BACKLOG_FREQUENCY: - BACKLOG_FREQUENCY = MIN_BACKLOG_FREQUENCY + BACKLOG_FREQUENCY = minimax(BACKLOG_FREQUENCY, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, MAX_BACKLOG_FREQUENCY) UPDATE_FREQUENCY = check_setting_int(CFG, 'General', 'update_frequency', DEFAULT_UPDATE_FREQUENCY) if UPDATE_FREQUENCY < MIN_UPDATE_FREQUENCY: @@ -1173,9 +1172,8 @@ def initialize(consoleLogging=True): run_delay=update_now if RECENTSEARCH_STARTUP else datetime.timedelta(minutes=5)) - update_interval = datetime.timedelta(minutes=BACKLOG_FREQUENCY) backlogSearchScheduler = searchBacklog.BacklogSearchScheduler(searchBacklog.BacklogSearcher(), - cycleTime=update_interval, + cycleTime=datetime.timedelta(minutes=get_backlog_cycle_time()), threadName="BACKLOG", run_delay=update_now if BACKLOG_STARTUP else datetime.timedelta(minutes=10)) diff --git a/sickbeard/config.py b/sickbeard/config.py index bd4d2cc6..7f0d629e 100644 --- a/sickbeard/config.py +++ b/sickbeard/config.py @@ -164,13 +164,9 @@ def change_RECENTSEARCH_FREQUENCY(freq): def change_BACKLOG_FREQUENCY(freq): - sickbeard.BACKLOG_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_BACKLOG_FREQUENCY) + sickbeard.BACKLOG_FREQUENCY = minimax(freq, sickbeard.DEFAULT_BACKLOG_FREQUENCY, sickbeard.MIN_BACKLOG_FREQUENCY, sickbeard.MAX_BACKLOG_FREQUENCY) - sickbeard.MIN_BACKLOG_FREQUENCY = sickbeard.get_backlog_cycle_time() - if sickbeard.BACKLOG_FREQUENCY < sickbeard.MIN_BACKLOG_FREQUENCY: - sickbeard.BACKLOG_FREQUENCY = sickbeard.MIN_BACKLOG_FREQUENCY - - sickbeard.backlogSearchScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.BACKLOG_FREQUENCY) + sickbeard.backlogSearchScheduler.action.cycleTime = sickbeard.BACKLOG_FREQUENCY def change_UPDATE_FREQUENCY(freq): @@ -740,4 +736,8 @@ class ConfigMigrator(): def _migrate_v9(self): sickbeard.PUSHBULLET_ACCESS_TOKEN = check_setting_str(self.config_obj, 'Pushbullet', 'pushbullet_api', '') - sickbeard.PUSHBULLET_DEVICE_IDEN = check_setting_str(self.config_obj, 'Pushbullet', 'pushbullet_device', '') \ No newline at end of file + sickbeard.PUSHBULLET_DEVICE_IDEN = check_setting_str(self.config_obj, 'Pushbullet', 'pushbullet_device', '') + + def _migrate_v10(self): + # reset backlog frequency to default + sickbeard.BACKLOG_FREQUENCY = sickbeard.DEFAULT_BACKLOG_FREQUENCY \ No newline at end of file diff --git a/sickbeard/searchBacklog.py b/sickbeard/searchBacklog.py index ab5a6605..81a2ff29 100644 --- a/sickbeard/searchBacklog.py +++ b/sickbeard/searchBacklog.py @@ -48,7 +48,7 @@ class BacklogSearcher: def __init__(self): self._lastBacklog = self._get_lastBacklog() - self.cycleTime = sickbeard.BACKLOG_FREQUENCY / 60 / 24 + self.cycleTime = sickbeard.BACKLOG_FREQUENCY self.lock = threading.Lock() self.amActive = False self.amPaused = False