diff --git a/gui/slick/interfaces/default/config_providers.tmpl b/gui/slick/interfaces/default/config_providers.tmpl index 810bf814..bf481174 100644 --- a/gui/slick/interfaces/default/config_providers.tmpl +++ b/gui/slick/interfaces/default/config_providers.tmpl @@ -157,12 +157,28 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; #end if + #if $hasattr($curNewznabProvider, 'backlog_only'): +
+ + +
+ #end if + #if $hasattr($curNewznabProvider, 'search_fallback'):
#end if @@ -170,14 +186,16 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; #if $hasattr($curNewznabProvider, 'search_mode'):
- @@ -335,12 +353,28 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
#end if + #if $hasattr($curTorrentProvider, 'backlog_only'): +
+ + +
+ #end if + #if $hasattr($curTorrentProvider, 'search_fallback'):
#end if @@ -349,13 +383,15 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
- diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 841266c1..4e1b83ad 100644 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -1026,7 +1026,11 @@ def initialize(consoleLogging=True): 'eponly') if hasattr(curTorrentProvider, 'search_fallback'): curTorrentProvider.search_fallback = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(), - curTorrentProvider.getID() + '_search_mode', + curTorrentProvider.getID() + '_search_fallback', + 0)) + if hasattr(curTorrentProvider, 'backlog_only'): + curTorrentProvider.backlog_only = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(), + curTorrentProvider.getID() + '_backlog_only', 0)) try: url = 'http://raw.github.com/echel0n/sickrage-init/master/settings.ini' @@ -1415,6 +1419,9 @@ def save_config(): if hasattr(curTorrentProvider, 'search_fallback'): new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_search_fallback'] = int( curTorrentProvider.search_fallback) + if hasattr(curTorrentProvider, 'backlog_only'): + new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_backlog_only'] = int( + curTorrentProvider.backlog_only) new_config['NZBs'] = {} new_config['NZBs']['nzbs'] = int(NZBS) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index a52534f6..516f4592 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -57,7 +57,8 @@ class GenericProvider: self.search_mode = None self.search_fallback = False - + self.backlog_only = False + self.cache = tvcache.TVCache(self) self.session = requests.session() diff --git a/sickbeard/search.py b/sickbeard/search.py index 61d3e3e8..2d9c5bd0 100644 --- a/sickbeard/search.py +++ b/sickbeard/search.py @@ -323,7 +323,7 @@ def searchForNeededEpisodes(episodes): # ask all providers for any episodes it finds origThreadName = threading.currentThread().name - providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive()] + providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive() and not x.backlog_only] for curProviderCount, curProvider in enumerate(providers): threading.currentThread().name = origThreadName + " :: [" + curProvider.name + "]" diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 705bf76b..20b83f3b 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1633,6 +1633,12 @@ class ConfigProviders: except: curTorrentProvider.search_fallback = 0 + if hasattr(curTorrentProvider, 'backlog_only'): + try: + curTorrentProvider.backlog_only = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_backlog_only']) + except: + curTorrentProvider.backlog_only = 0 + sickbeard.OMGWTFNZBS_USERNAME = kwargs['omgwtfnzbs_username'].strip() sickbeard.OMGWTFNZBS_APIKEY = kwargs['omgwtfnzbs_apikey'].strip()