From b0ec12e4217097a65d7622560005a18e0e23d968 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 27 Apr 2014 05:13:46 -0700 Subject: [PATCH] Fixes issue with update frequency. Fixes backlog search issues with newznab providers. --- sickbeard/__init__.py | 8 ++++++-- sickbeard/providers/generic.py | 5 +++-- sickbeard/providers/newznab.py | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index c1eab6b1..5233407e 100644 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -628,6 +628,10 @@ def initialize(consoleLogging=True): if SEARCH_FREQUENCY < MIN_SEARCH_FREQUENCY: SEARCH_FREQUENCY = MIN_SEARCH_FREQUENCY + UPDATE_FREQUENCY = check_setting_int(CFG, 'General', 'update_frequency', DEFAULT_UPDATE_FREQUENCY) + if UPDATE_FREQUENCY < UPDATE_FREQUENCY: + UPDATE_FREQUENCY = UPDATE_FREQUENCY + NZB_DIR = check_setting_str(CFG, 'Blackhole', 'nzb_dir', '') TORRENT_DIR = check_setting_str(CFG, 'Blackhole', 'torrent_dir', '') @@ -976,7 +980,7 @@ def initialize(consoleLogging=True): # initialize newznab providers currentSearchScheduler = scheduler.Scheduler(searchCurrent.CurrentSearcher(), - cycleTime=datetime.timedelta(minutes=SEARCH_FREQUENCY or DEFAULT_SEARCH_FREQUENCY), + cycleTime=datetime.timedelta(minutes=SEARCH_FREQUENCY), threadName="SEARCH", runImmediately=True) @@ -988,7 +992,7 @@ def initialize(consoleLogging=True): runImmediately=False) versionCheckScheduler = scheduler.Scheduler(versionChecker.CheckVersion(), - cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY or DEFAULT_UPDATE_FREQUENCY), + cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY), threadName="CHECKVERSION", runImmediately=True) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 9a5a82ae..3181e619 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -246,8 +246,9 @@ class GenericProvider: self._checkAuth() for ep_obj in ep_objs: - logger.log(u'Searching "%s" for "%s" as "%s"' - % (self.name, ep_obj.prettyName(), ep_obj.scene_prettyName())) + if not seasonSearch: + logger.log(u'Searching "%s" for "%s" as "%s"' + % (self.name, ep_obj.prettyName(), ep_obj.scene_prettyName())) self.cache.updateCache() results = self.cache.searchCache(ep_obj, manualSearch) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index 864a830e..fc220bf5 100644 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -98,10 +98,11 @@ class NewznabProvider(generic.NZBProvider): # season cur_params['season'] = str(season) - to_return.append(cur_params) # episode - to_return['episode'] = self._get_episode_search_strings(show, season, episode, abd)[0]['ep'] + cur_params['episode'] = self._get_episode_search_strings(show, season, episode, abd)[0]['ep'] + + to_return.append(cur_params) return to_return