From e96035ff4fbb33d098e03008a483e382fe03cca5 Mon Sep 17 00:00:00 2001 From: echel0n Date: Fri, 16 May 2014 22:23:11 -0700 Subject: [PATCH] Added per-provider options search mode and search fallback. Search mode allows you to choose season packs only or episodes only which controls how backlogs search for data. Search fallback if selected will attempt a 2nd search this time using the alternative search mode to see if it can get results if the previous attempt failed. Provider settings are now read and stored dynamically instead of always having to retrieve them by there static names, this will allow for dropping in new provider modules easier to intergrate with existing options already present. Fixed search code to not perform dupe searches by mistake. Cache stores a list of shows we have rejected so that next time around we don't have to process them to know we don't like em. --- .../interfaces/default/config_providers.tmpl | 384 ++++++---------- gui/slick/js/configProviders.js | 12 +- sickbeard/__init__.py | 375 +++++----------- sickbeard/providers/__init__.py | 19 +- sickbeard/providers/btn.py | 14 +- sickbeard/providers/dtt.py | 11 +- sickbeard/providers/ezrss.py | 11 +- sickbeard/providers/generic.py | 12 +- sickbeard/providers/hdbits.py | 21 +- sickbeard/providers/hdtorrents.py | 23 +- sickbeard/providers/iptorrents.py | 17 +- sickbeard/providers/kat.py | 10 +- sickbeard/providers/newznab.py | 12 +- sickbeard/providers/nextgen.py | 13 +- sickbeard/providers/nyaatorrents.py | 9 +- sickbeard/providers/publichd.py | 7 +- sickbeard/providers/scc.py | 15 +- sickbeard/providers/speedcd.py | 19 +- sickbeard/providers/thepiratebay.py | 16 +- sickbeard/providers/torrentday.py | 28 +- sickbeard/providers/torrentleech.py | 13 +- sickbeard/providers/tvtorrents.py | 14 +- sickbeard/search.py | 410 +++++++++--------- sickbeard/search_queue.py | 12 +- sickbeard/webserve.py | 211 ++++----- 25 files changed, 754 insertions(+), 934 deletions(-) diff --git a/gui/slick/interfaces/default/config_providers.tmpl b/gui/slick/interfaces/default/config_providers.tmpl index a24b717e..3a7d65df 100644 --- a/gui/slick/interfaces/default/config_providers.tmpl +++ b/gui/slick/interfaces/default/config_providers.tmpl @@ -115,8 +115,8 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; Configure Provider: #set $provider_config_list = [] - #for $cur_provider in ("thepiratebay", "tvtorrents", "btn", "torrentleech", "iptorrents", "omgwtfnzbs", "kickasstorrents", "sceneaccess", "hdbits", "nextgen", "speedcd"): - #set $cur_provider_obj = $sickbeard.providers.getProviderClass($cur_provider) + #for $curProvider in $sickbeard.providers.sortedProviderList(): + #set $cur_provider_obj = $sickbeard.providers.getProviderClass($curProvider.getID()) #if $cur_provider_obj.providerType == $GenericProvider.NZB and not $sickbeard.USE_NZBS: #continue #elif $cur_provider_obj.providerType == $GenericProvider.TORRENT and not $sickbeard.USE_TORRENTS: @@ -140,8 +140,9 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; -#for $curNewznabProvider in [$curProvider for $curProvider in $sickbeard.newznabProviderList if $curProvider.default and $curProvider.needs_auth]: +#for $curNewznabProvider in [$curProvider for $curProvider in $sickbeard.newznabProviderList]:
+ #if $curProvider.default and $curProvider.needs_auth
+ #end if + + #if $hasattr($curNewznabProvider, 'search_fallback'): +
+ + +
+ #end if + + #if $hasattr($curNewznabProvider, 'search_mode'): +
+ + +
+ #end if
#end for @@ -172,304 +201,171 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; -
+#for $curTorrentProvider in [$curProvider for $curProvider in $sickbeard.providers.sortedProviderList() if $curProvider.providerType == $GenericProvider.TORRENT]: +
+ #if $hasattr($curTorrentProvider, 'api_key'):
-
+ #end if -
+ #if $hasattr($curTorrentProvider, 'digest'):
+ #end if + + #if $hasattr($curTorrentProvider, 'hash'):
+ #end if -
-