From 736cb7c738e7902196fc6c99dd810543539a75f2 Mon Sep 17 00:00:00 2001 From: echel0n Date: Thu, 22 May 2014 22:02:49 -0700 Subject: [PATCH] Fixes issues with ABD shows searching for complete seasons and returning zero results. --- gui/slick/css/default.css | 6 +++--- gui/slick/css/token-input.css | 2 +- gui/slick/interfaces/default/home.tmpl | 1 - sickbeard/providers/btn.py | 2 +- sickbeard/providers/ezrss.py | 2 +- sickbeard/providers/hdtorrents.py | 2 +- sickbeard/providers/iptorrents.py | 2 +- sickbeard/providers/kat.py | 4 ++-- sickbeard/providers/newznab.py | 26 +++++++++++++++++--------- sickbeard/providers/nextgen.py | 2 +- sickbeard/providers/publichd.py | 4 ++-- sickbeard/providers/scc.py | 2 +- sickbeard/providers/speedcd.py | 2 +- sickbeard/providers/thepiratebay.py | 4 ++-- sickbeard/providers/torrentday.py | 2 +- sickbeard/providers/torrentleech.py | 2 +- sickbeard/show_name_helpers.py | 2 +- sickbeard/show_queue.py | 4 +++- sickbeard/webserve.py | 18 ++++++++++-------- 19 files changed, 50 insertions(+), 39 deletions(-) diff --git a/gui/slick/css/default.css b/gui/slick/css/default.css index 9a4d134a..a1ea84ea 100644 --- a/gui/slick/css/default.css +++ b/gui/slick/css/default.css @@ -432,7 +432,7 @@ input:not(.btn){margin-right:6px;margin-top:5px;padding-top:4px;padding-bottom:4 } .sickbeardTable tfoot a { text-decoration: none; - color: #bde433; + color: #6196c2; float: left; } .sickbeardTable td { @@ -1437,7 +1437,7 @@ span.true { .btn:focus, .btn:active { - border: 1px solid #4d90fe; + border: 1px solid #6196c2; outline: none; -moz-box-shadow: none; box-shadow: none; @@ -1851,7 +1851,7 @@ pre { .vertical { display: inline-block; - background-color: #79DF46; + background-color: #6196c2; border-radius: 0 4px 4px 0; border-width: 3px 3px 3px 0; border-style: solid; diff --git a/gui/slick/css/token-input.css b/gui/slick/css/token-input.css index fb9a8437..e94cd326 100644 --- a/gui/slick/css/token-input.css +++ b/gui/slick/css/token-input.css @@ -128,7 +128,7 @@ div.token-input-dropdown ul li em { } div.token-input-dropdown ul li.token-input-selected-dropdown-item { - background-color: #d0efa0; + background-color: #6196c2; } span.token-input-delete-token { diff --git a/gui/slick/interfaces/default/home.tmpl b/gui/slick/interfaces/default/home.tmpl index 63aed659..92f0f5b3 100644 --- a/gui/slick/interfaces/default/home.tmpl +++ b/gui/slick/interfaces/default/home.tmpl @@ -131,7 +131,6 @@ #end if
- You are using BETA software.
Layout: Poster · Banner · diff --git a/sickbeard/providers/btn.py b/sickbeard/providers/btn.py index c04d7ebb..257ef416 100644 --- a/sickbeard/providers/btn.py +++ b/sickbeard/providers/btn.py @@ -217,7 +217,7 @@ class BTNProvider(generic.TorrentProvider): whole_season_params['category'] = 'Season' if ep_obj.show.air_by_date or ep_obj.show.sports: # Search for the year of the air by date show - whole_season_params['name'] = str(ep_obj.airdate)[:7] + whole_season_params['name'] = str(ep_obj.airdate).split('-')[0] else: whole_season_params['name'] = 'Season ' + str(ep_obj.scene_season) diff --git a/sickbeard/providers/ezrss.py b/sickbeard/providers/ezrss.py index 20398746..1ccf4e98 100644 --- a/sickbeard/providers/ezrss.py +++ b/sickbeard/providers/ezrss.py @@ -82,7 +82,7 @@ class EZRSSProvider(generic.TorrentProvider): params['show_name'] = helpers.sanitizeSceneName(self.show.name, ezrss=True).replace('.', ' ').encode('utf-8') if ep_obj.show.air_by_date or ep_obj.show.sports: - params['season'] = str(ep_obj.airdate)[:7] + params['season'] = str(ep_obj.airdate).split('-')[0] else: params['season'] = ep_obj.scene_season diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index 5d48105a..ef44a5ef 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -125,7 +125,7 @@ class HDTorrentsProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index ec48aa40..4a0a4c9c 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -102,7 +102,7 @@ class IPTorrentsProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index d4136b5f..b15c2b4b 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -177,13 +177,13 @@ class KATProvider(generic.TorrentProvider): if not (ep_obj.show.air_by_date or ep_obj.show.sports): for show_name in set(allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ' category:tv' #2) showName Season X + ep_string = show_name + str(ep_obj.airdate).split('-')[0] + ' category:tv' #2) showName Season X else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) + ' -S%02d' % int(ep_obj.scene_season) + 'E' + ' category:tv' #1) showName SXX -SXXE search_string['Season'].append(ep_string) if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + ' Season ' + str(ep_obj.airdate)[:7] + ' category:tv' #2) showName Season X + ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0] + ' category:tv' #2) showName Season X else: ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*' + ' category:tv' #2) showName Season X search_string['Season'].append(ep_string) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index b279e10d..ae7650a4 100644 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -92,15 +92,24 @@ class NewznabProvider(generic.NZBProvider): cur_params = {} # search - cur_params['q'] = helpers.sanitizeSceneName(cur_exception) + if ep_obj.show.indexer == 2: + cur_params['rid'] = ep_obj.show.indexerid + else: + cur_params['q'] = helpers.sanitizeSceneName(cur_exception) # season if ep_obj.show.air_by_date or ep_obj.show.sports: - cur_params['season'] = str(ep_obj.airdate)[:7] + date_str = str(ep_obj.airdate).split('-')[0] + cur_params['season'] = date_str + if 'q' in cur_params: + cur_params['q'] += '.' + date_str.replace('-', '.') + else: + cur_params['q'] = date_str.replace('-', '.') else: cur_params['season'] = str(ep_obj.scene_season) - to_return.append(cur_params) + if not ('rid' in cur_params and to_return): + to_return.append(cur_params) return to_return @@ -112,13 +121,12 @@ class NewznabProvider(generic.NZBProvider): return [params] # search - params['q'] = helpers.sanitizeSceneName(self.show.name) + if ep_obj.show.indexer == 2: + params['rid'] = ep_obj.show.indexerid + else: + params['q'] = helpers.sanitizeSceneName(self.show.name) - if self.show.air_by_date: - date_str = str(ep_obj.airdate) - params['season'] = date_str.partition('-')[0] - params['ep'] = date_str.partition('-')[2].replace('-', '/') - elif self.show.sports: + if self.show.air_by_date or self.show.sports: date_str = str(ep_obj.airdate) params['season'] = date_str.partition('-')[0] params['ep'] = date_str.partition('-')[2].replace('-', '/') diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py index 530140d1..9ccabbbd 100644 --- a/sickbeard/providers/nextgen.py +++ b/sickbeard/providers/nextgen.py @@ -141,7 +141,7 @@ class NextGenProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/providers/publichd.py b/sickbeard/providers/publichd.py index 52756bf5..bebd2a87 100644 --- a/sickbeard/providers/publichd.py +++ b/sickbeard/providers/publichd.py @@ -83,13 +83,13 @@ class PublicHDProvider(generic.TorrentProvider): for show_name in set(allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX -SXXE search_string['Season'].append(ep_string) if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + ' Season ' + str(ep_obj.airdate)[:7] + ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' Season ' + str(ep_obj.scene_season) #2) showName Season X search_string['Season'].append(ep_string) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index dfa1a982..d3198157 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -112,7 +112,7 @@ class SCCProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/providers/speedcd.py b/sickbeard/providers/speedcd.py index f424ff0d..2d92ef17 100644 --- a/sickbeard/providers/speedcd.py +++ b/sickbeard/providers/speedcd.py @@ -102,7 +102,7 @@ class SpeedCDProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name +' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index 772e5411..21539bfd 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -169,13 +169,13 @@ class ThePirateBayProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(allPossibleShowNames(self.show)) if not (ep_obj.show.air_by_date or ep_obj.show.sports) else []: if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX search_string['Season'].append(ep_string) if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + ' Season ' + str(ep_obj.airdate)[:7] + ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*' #2) showName Season X diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index 95738fd8..da45757b 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -133,7 +133,7 @@ class TorrentDayProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index 1e13efe2..4ed0478f 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -107,7 +107,7 @@ class TorrentLeechProvider(generic.TorrentProvider): search_string = {'Season': []} for show_name in set(show_name_helpers.allPossibleShowNames(self.show)): if ep_obj.show.air_by_date or ep_obj.show.sports: - ep_string = show_name + str(ep_obj.airdate)[:7] + ep_string = show_name + str(ep_obj.airdate).split('-')[0] else: ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index 18ea3337..6b3bc93d 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -120,7 +120,7 @@ def makeSceneSeasonSearchString(show, ep_obj, extraSearchType=None): numseasons = int(numseasonsSQlResult[0][0]) if show.air_by_date or show.sports: - seasonStrings = [str(ep_obj.airdate)[:7]] + seasonStrings = [str(ep_obj.airdate).split('-')[0]] else: seasonStrings = ["S%02d" % int(ep_obj.scene_season)] diff --git a/sickbeard/show_queue.py b/sickbeard/show_queue.py index 8837255a..04ba4850 100644 --- a/sickbeard/show_queue.py +++ b/sickbeard/show_queue.py @@ -288,7 +288,9 @@ class QueueItemAdd(ShowQueueItem): # be smartish about this if self.show.genre and "talk show" in self.show.genre.lower(): self.show.air_by_date = 1 - elif self.show.classification and "sports" in self.show.classification.lower(): + if self.show.genre and "documentary" in self.show.genre.lower(): + self.show.air_by_date = 0 + if self.show.classification and "sports" in self.show.classification.lower(): self.show.sports = 1 diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 547f47e5..3c3047da 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3078,15 +3078,17 @@ class Home: errors.append("Unable to refresh this show: " + ex(e)) showObj.paused = paused - showObj.air_by_date = air_by_date - showObj.sports = sports - showObj.subtitles = subtitles - showObj.lang = indexer_lang - showObj.dvdorder = dvdorder - showObj.archive_firstmatch = archive_firstmatch - showObj.rls_ignore_words = rls_ignore_words - showObj.rls_require_words = rls_require_words + # if this routine was called via the mass edit, do not change the options that are not passed + if not directCall: + showObj.air_by_date = air_by_date + showObj.sports = sports + showObj.subtitles = subtitles + showObj.lang = indexer_lang + showObj.dvdorder = dvdorder + showObj.archive_firstmatch = archive_firstmatch + showObj.rls_ignore_words = rls_ignore_words.strip() + showObj.rls_require_words = rls_require_words.strip() # if we change location clear the db of episodes, change it, write to db, and rescan if os.path.normpath(showObj._location) != os.path.normpath(location):