From cadb2dba722e1a893eaa30e4b1129bddb567ca34 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 2 Jul 2014 12:36:00 -0700 Subject: [PATCH 1/4] Testing fix for post-processing and search issues. --- sickbeard/helpers.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index b4bbbf84..18f1133a 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -298,8 +298,7 @@ def searchDBForShow(regShowName, log=False): [showName]) if len(sqlResults) == 1: - return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"]) - + return int(sqlResults[0]["indexer_id"]) else: # if we didn't get exactly one result then try again with the year stripped off if possible match = re.match(yearRegex, showName) @@ -321,10 +320,7 @@ def searchDBForShow(regShowName, log=False): logger.DEBUG) continue else: - return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"]) - - return - + return int(sqlResults[0]["indexer_id"]) def searchIndexerForShowID(regShowName, indexer=None, indexer_id=None, ui=None): showNames = [re.sub('[. -]', ' ', regShowName)] @@ -1077,10 +1073,16 @@ def get_show_by_name(name, useIndexer=False): showObj = sickbeard.name_cache.retrieveShowFromCache(name) if showObj: return showObj + if not showObj and sickbeard.showList: - scene_indexerid, scene_season = sickbeard.scene_exceptions.get_scene_exception_by_name(name) - if scene_indexerid: - showObj = findCertainShow(sickbeard.showList, scene_indexerid) + db_indexerid = searchDBForShow(name) + if db_indexerid: + showObj = findCertainShow(sickbeard.showList, db_indexerid) + + if not showObj: + scene_indexerid, scene_season = sickbeard.scene_exceptions.get_scene_exception_by_name(name) + if scene_indexerid: + showObj = findCertainShow(sickbeard.showList, scene_indexerid) if useIndexer and not showObj: (sn, idx, id) = searchIndexerForShowID(name, ui=classes.ShowListUI) From d6431570f16ee3324c3ff1e2901190ed897da24d Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 2 Jul 2014 13:06:29 -0700 Subject: [PATCH 2/4] TPB season pack searches fixed --- sickbeard/providers/thepiratebay.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index 4ddc2a60..5e4c2653 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -180,11 +180,9 @@ class ThePirateBayProvider(generic.TorrentProvider): ep_string = show_name + ' ' + "%d" % ep_obj.scene_absolute_number search_string['Season'].append(ep_string) 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 + ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) search_string['Season'].append(ep_string) - ep_string = show_name + ' Season ' + str( - ep_obj.scene_season) + ' -Ep*' + ' category:tv' # 2) showName Season X + ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*' search_string['Season'].append(ep_string) search_string['Season'].append(ep_string) From ddd9376faf8706869fb088ff6e235b477643e1c6 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 2 Jul 2014 13:38:05 -0700 Subject: [PATCH 3/4] Fix for torrentday uid issues. --- sickbeard/providers/torrentday.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index 23b98364..3e7da459 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -54,8 +54,8 @@ class TorrentDayProvider(generic.TorrentProvider): self.supportsBacklog = True self.enabled = False - self.uid = None - self.hash = None + self._uid = None + self._hash = None self.username = None self.password = None self.ratio = None @@ -91,7 +91,7 @@ class TorrentDayProvider(generic.TorrentProvider): if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()): return True - if self.uid and self.hash: + if self._uid and self._hash: requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies) @@ -118,11 +118,11 @@ class TorrentDayProvider(generic.TorrentProvider): return False if requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] and requests.utils.dict_from_cookiejar(self.session.cookies)['pass']: - self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] - self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass'] + self._uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] + self._hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass'] - self.cookies = {'uid': self.uid, - 'pass': self.hash + self.cookies = {'uid': self._uid, + 'pass': self._hash } return True From 36e12a5d4d0f5645cd0ff4db34c03a4709f0693b Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 2 Jul 2014 13:39:27 -0700 Subject: [PATCH 4/4] Fix for hdtorrents uid issues. --- sickbeard/providers/hdtorrents.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index 5f27d351..9f9fa2e9 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -57,8 +57,8 @@ class HDTorrentsProvider(generic.TorrentProvider): self.supportsBacklog = True self.enabled = False - self.uid = None - self.hash = None + self._uid = None + self._hash = None self.username = None self.password = None self.ratio = None @@ -92,7 +92,7 @@ class HDTorrentsProvider(generic.TorrentProvider): if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()): return True - if self.uid and self.hash: + if self._uid and self._hash: requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies) @@ -114,11 +114,11 @@ class HDTorrentsProvider(generic.TorrentProvider): logger.log(u'Invalid username or password for ' + self.name + ' Check your settings', logger.ERROR) return False - self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] - self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass'] + self._uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] + self._hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass'] - self.cookies = {'uid': self.uid, - 'pass': self.hash + self.cookies = {'uid': self._uid, + 'pass': self._hash } return True