Fixes issue with update frequency.

Fixes backlog search issues with newznab providers.
This commit is contained in:
echel0n 2014-04-27 05:13:46 -07:00
parent 831e9a537e
commit b0ec12e421
3 changed files with 12 additions and 6 deletions

View file

@ -628,6 +628,10 @@ def initialize(consoleLogging=True):
if SEARCH_FREQUENCY < MIN_SEARCH_FREQUENCY: if SEARCH_FREQUENCY < MIN_SEARCH_FREQUENCY:
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', '') NZB_DIR = check_setting_str(CFG, 'Blackhole', 'nzb_dir', '')
TORRENT_DIR = check_setting_str(CFG, 'Blackhole', 'torrent_dir', '') TORRENT_DIR = check_setting_str(CFG, 'Blackhole', 'torrent_dir', '')
@ -976,7 +980,7 @@ def initialize(consoleLogging=True):
# initialize newznab providers # initialize newznab providers
currentSearchScheduler = scheduler.Scheduler(searchCurrent.CurrentSearcher(), currentSearchScheduler = scheduler.Scheduler(searchCurrent.CurrentSearcher(),
cycleTime=datetime.timedelta(minutes=SEARCH_FREQUENCY or DEFAULT_SEARCH_FREQUENCY), cycleTime=datetime.timedelta(minutes=SEARCH_FREQUENCY),
threadName="SEARCH", threadName="SEARCH",
runImmediately=True) runImmediately=True)
@ -988,7 +992,7 @@ def initialize(consoleLogging=True):
runImmediately=False) runImmediately=False)
versionCheckScheduler = scheduler.Scheduler(versionChecker.CheckVersion(), versionCheckScheduler = scheduler.Scheduler(versionChecker.CheckVersion(),
cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY or DEFAULT_UPDATE_FREQUENCY), cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY),
threadName="CHECKVERSION", threadName="CHECKVERSION",
runImmediately=True) runImmediately=True)

View file

@ -246,8 +246,9 @@ class GenericProvider:
self._checkAuth() self._checkAuth()
for ep_obj in ep_objs: for ep_obj in ep_objs:
logger.log(u'Searching "%s" for "%s" as "%s"' if not seasonSearch:
% (self.name, ep_obj.prettyName(), ep_obj.scene_prettyName())) logger.log(u'Searching "%s" for "%s" as "%s"'
% (self.name, ep_obj.prettyName(), ep_obj.scene_prettyName()))
self.cache.updateCache() self.cache.updateCache()
results = self.cache.searchCache(ep_obj, manualSearch) results = self.cache.searchCache(ep_obj, manualSearch)

View file

@ -98,10 +98,11 @@ class NewznabProvider(generic.NZBProvider):
# season # season
cur_params['season'] = str(season) cur_params['season'] = str(season)
to_return.append(cur_params)
# episode # 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 return to_return