1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Fix for BTN season pack searches

This commit is contained in:
echel0n 2014-05-12 09:35:40 -07:00
parent 5b23d83704
commit a5794a5347

View File

@ -192,7 +192,6 @@ class BTNProvider(generic.TorrentProvider):
search_params = []
name_exceptions = scene_exceptions.get_scene_exceptions(self.show.indexerid) + [self.show.name]
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
for name in name_exceptions:
current_params = {}
@ -207,13 +206,26 @@ class BTNProvider(generic.TorrentProvider):
# Search for entire seasons: no need to do special things for air by date shows
whole_season_params = current_params.copy()
partial_season_params = current_params.copy()
# Search for entire seasons: no need to do special things for air by date shows
whole_season_params['category'] = 'Season'
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
whole_season_params['name'] = 'Season ' + str(ep_obj.scene_season)
elif ep_obj.show.air_by_date or ep_obj.show.sports:
whole_season_params['name'] = self._get_episode_search_strings(ep_obj)[0]['name']
search_params.append(whole_season_params)
# Search for episodes in the season
partial_season_params['category'] = 'Episode'
if ep_obj.show.air_by_date or ep_obj.show.sports:
# Search for the year of the air by date show
partial_season_params['name'] = str(ep_obj.airdate).split('-')[0]
else:
# Search for any result which has Sxx in the name
partial_season_params['name'] = 'S%02d' % int(ep_obj.scene_season)
search_params.append(partial_season_params)
return search_params
def _get_episode_search_strings(self, ep_obj, add_string=''):
@ -236,7 +248,7 @@ class BTNProvider(generic.TorrentProvider):
# BTN uses dots in dates, we just search for the date since that
# combined with the series identifier should result in just one episode
search_params['name'] = date_str.replace('-', '.')
if self.show.sports:
elif self.show.sports:
date_str = str(ep_obj.airdate)
# BTN uses dots in dates, we just search for the date since that