diff --git a/sickbeard/providers/btn.py b/sickbeard/providers/btn.py index bc0af440..ab60fa04 100644 --- a/sickbeard/providers/btn.py +++ b/sickbeard/providers/btn.py @@ -268,10 +268,10 @@ class BTNProvider(generic.TorrentProvider): return to_return - def _doGeneralSearch(self, search_string): + def _doGeneralSearch(self, search_string, show=None): # 'search' looks as broad is it can find. Can contain episode overview and title for example, # use with caution! - return self._doSearch({'search': search_string}) + return self._doSearch({'search': search_string}, show=show) def findPropers(self, search_date=None): results = [] diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 47fd1e5c..a405b651 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -261,15 +261,11 @@ class GenericProvider: if results: return results - abd = False - if show.air_by_date: - abd = True - if seasonSearch: - for curString in self._get_season_search_strings(show, ep_obj.scene_season, ep_obj.scene_episode if not abd else ep_obj._airdate, abd=abd): - itemList += self._doSearch(curString) + for curString in self._get_season_search_strings(show, ep_obj.scene_season, ep_obj.scene_episode, show.air_by_date): + itemList += self._doSearch(curString, show=show) else: - for curString in self._get_episode_search_strings(show, ep_obj.scene_season, ep_obj.scene_episode if not abd else ep_obj._airdate, abd=abd): + for curString in self._get_episode_search_strings(show, ep_obj.scene_season, ep_obj.scene_episode, show.air_by_date): itemList += self._doSearch(curString, show=show) for item in itemList: diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index 59827fc5..9c7f6a21 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -309,7 +309,7 @@ class HDTorrentsProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index 9252006f..1910e768 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -256,7 +256,7 @@ class IPTorrentsProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index d4d20188..c09a137a 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -390,7 +390,7 @@ class KATProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index fc220bf5..8498ea7e 100644 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -144,8 +144,8 @@ class NewznabProvider(generic.NZBProvider): return to_return - def _doGeneralSearch(self, search_string): - return self._doSearch({'q': search_string}) + def _doGeneralSearch(self, search_string, show=None): + return self._doSearch({'q': search_string}, show=show) def _checkAuth(self): diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py index 447c7a82..d14242e8 100644 --- a/sickbeard/providers/nextgen.py +++ b/sickbeard/providers/nextgen.py @@ -303,7 +303,7 @@ class NextGenProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/publichd.py b/sickbeard/providers/publichd.py index e6a2f983..3c99f9a2 100644 --- a/sickbeard/providers/publichd.py +++ b/sickbeard/providers/publichd.py @@ -278,7 +278,7 @@ class PublicHDProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index 1d52f9f2..a0682caa 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -280,7 +280,7 @@ class SCCProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/speedcd.py b/sickbeard/providers/speedcd.py index 27498ac1..e8069cd8 100644 --- a/sickbeard/providers/speedcd.py +++ b/sickbeard/providers/speedcd.py @@ -239,7 +239,7 @@ class SpeedCDProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index 99f94bc3..4d4fd838 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -384,7 +384,7 @@ class ThePirateBayProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index ad7417f2..89335736 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -252,7 +252,7 @@ class TorrentDayProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index 35f048f3..eb555c02 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -255,7 +255,7 @@ class TorrentLeechProvider(generic.TorrentProvider): curEp = curShow.getEpisode(int(sqlShow["season"]), int(sqlShow["episode"])) searchString = self._get_episode_search_strings(curShow, curEp.scene_season, curEp.scene_episode, curShow.air_by_date, add_string='PROPER|REPACK') - for item in self._doSearch(searchString[0]): + for item in self._doSearch(searchString[0], show=curShow): title, url = self._get_title_and_url(item) results.append(classes.Proper(title, url, datetime.datetime.today())) diff --git a/sickbeard/subtitles.py b/sickbeard/subtitles.py index fcdd3d4c..7bb15f2b 100644 --- a/sickbeard/subtitles.py +++ b/sickbeard/subtitles.py @@ -119,6 +119,7 @@ class SubtitlesFinder(): continue # Old shows rule + throwaway = datetime.datetime.strptime('20110101', '%Y%m%d') if ((epToSub['airdate_daydiff'] > 7 and epToSub['searchcount'] < 2 and now - datetime.datetime.strptime(epToSub['lastsearch'], '%Y-%m-%d %H:%M:%S') > datetime.timedelta(hours=rules['old'][epToSub['searchcount']])) or # Recent shows rule (epToSub['airdate_daydiff'] <= 7 and epToSub['searchcount'] < 7 and now - datetime.datetime.strptime(epToSub['lastsearch'], '%Y-%m-%d %H:%M:%S') > datetime.timedelta(hours=rules['new'][epToSub['searchcount']]))):