mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Fix for air-by-date and sports shows when searching for full seasons.
Fix for rssupdater errors
This commit is contained in:
parent
51ff041389
commit
415e0df536
18 changed files with 92 additions and 104 deletions
|
@ -373,7 +373,8 @@ class ParseResult(object):
|
|||
return to_return.encode('utf-8')
|
||||
|
||||
def convert(self):
|
||||
if self.air_by_date: return self # scene numbering does not apply to air-by-date
|
||||
if not self.series_name: return self # can't work without a series name
|
||||
if self.air_by_date or self.sports: return self # scene numbering does not apply to air-by-date
|
||||
if self.season_number == None: return self # can't work without a season
|
||||
if len(self.episode_numbers) == 0: return self # need at least one episode
|
||||
|
||||
|
|
|
@ -210,21 +210,13 @@ class BTNProvider(generic.TorrentProvider):
|
|||
|
||||
# Search for entire seasons: no need to do special things for air by date shows
|
||||
whole_season_params['category'] = 'Season'
|
||||
whole_season_params['name'] = 'Season ' + str(ep_obj.scene_season)
|
||||
|
||||
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]
|
||||
whole_season_params['name'] = str(ep_obj.airdate)[:7]
|
||||
else:
|
||||
# Search for any result which has Sxx in the name
|
||||
partial_season_params['name'] = 'S%02d' % int(ep_obj.scene_season)
|
||||
whole_season_params['name'] = 'Season ' + str(ep_obj.scene_season)
|
||||
|
||||
search_params.append(partial_season_params)
|
||||
search_params.append(whole_season_params)
|
||||
|
||||
return search_params
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class DTTProvider(generic.TorrentProvider):
|
|||
return quality
|
||||
|
||||
def getSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
return generic.TorrentProvider.getSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
return generic.TorrentProvider.findSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
|
||||
def _dtt_show_id(self, show_name):
|
||||
return sanitizeSceneName(show_name).replace('.', '-').lower()
|
||||
|
|
|
@ -68,7 +68,7 @@ class EZRSSProvider(generic.TorrentProvider):
|
|||
logger.WARNING)
|
||||
return results
|
||||
|
||||
results = generic.TorrentProvider.getSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
results = generic.TorrentProvider.findSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
|
||||
return results
|
||||
|
||||
|
@ -78,12 +78,10 @@ class EZRSSProvider(generic.TorrentProvider):
|
|||
|
||||
params['show_name'] = helpers.sanitizeSceneName(self.show.name, ezrss=True).replace('.', ' ').encode('utf-8')
|
||||
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
params['season'] = ep_obj.scene_season
|
||||
if ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
params['season'] = str(ep_obj.airdate)[:7]
|
||||
else:
|
||||
params['season'] = self._get_episode_search_strings(ep_obj)[0]['season']
|
||||
|
||||
#params['episode'] = self._get_episode_search_strings(ep_obj)[0]['episode']
|
||||
params['season'] = ep_obj.scene_season
|
||||
|
||||
return [params]
|
||||
|
||||
|
|
|
@ -153,12 +153,18 @@ class HDBitsProvider(generic.TorrentProvider):
|
|||
'episode': episode.scene_episode
|
||||
}
|
||||
|
||||
if season:
|
||||
post_data['tvdb'] = {
|
||||
'id': show.indexerid,
|
||||
'season': season,
|
||||
}
|
||||
|
||||
if season:
|
||||
if show.air_by_date or show.sports:
|
||||
post_data['tvdb'] = {
|
||||
'id': show.indexerid,
|
||||
'season': str(episode.airdate)[:7],
|
||||
}
|
||||
else:
|
||||
post_data['tvdb'] = {
|
||||
'id': show.indexerid,
|
||||
'season': season,
|
||||
}
|
||||
|
||||
if search_term:
|
||||
post_data['search'] = search_term
|
||||
|
||||
|
|
|
@ -114,15 +114,14 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -94,15 +94,13 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -170,17 +170,18 @@ 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)):
|
||||
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
|
||||
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
|
||||
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)
|
||||
|
||||
ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*' + ' category:tv' #2) showName Season X
|
||||
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
|
||||
else:
|
||||
ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*' + ' category:tv' #2) showName Season X
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
|
||||
return [search_string]
|
||||
|
||||
def _get_episode_search_strings(self, ep_obj, add_string=''):
|
||||
|
|
|
@ -94,19 +94,13 @@ class NewznabProvider(generic.NZBProvider):
|
|||
cur_params['q'] = helpers.sanitizeSceneName(cur_exception)
|
||||
|
||||
# season
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
if ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
cur_params['season'] = str(ep_obj.airdate)[:7]
|
||||
else:
|
||||
cur_params['season'] = str(ep_obj.scene_season)
|
||||
|
||||
to_return.append(cur_params)
|
||||
|
||||
cur_params = {}
|
||||
if ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
cur_params['season'] = self._get_episode_search_strings(ep_obj)[0]['season']
|
||||
|
||||
#cur_params['episode'] = self._get_episode_search_strings(ep_obj)[0]['ep']
|
||||
|
||||
to_return.append(cur_params)
|
||||
|
||||
return to_return
|
||||
|
||||
def _get_episode_search_strings(self, ep_obj, add_string=''):
|
||||
|
|
|
@ -134,15 +134,13 @@ class NextGenProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -50,18 +50,17 @@ class NyaaProvider(generic.TorrentProvider):
|
|||
return 'nyaatorrents.png'
|
||||
|
||||
def getQuality(self, item, anime=False):
|
||||
self.debug()
|
||||
title = item.title
|
||||
quality = Quality.sceneQuality(title)
|
||||
return quality
|
||||
|
||||
def getSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
results = generic.TorrentProvider.getSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
results = generic.TorrentProvider.findSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
return results
|
||||
|
||||
def _get_season_search_strings(self, ep_obj):
|
||||
names = []
|
||||
names.extend(show_name_helpers.makeSceneshowSearchStrings(self.show))
|
||||
names.extend(show_name_helpers.makeSceneShowSearchStrings(self.show))
|
||||
return names
|
||||
|
||||
def _get_episode_search_strings(self, ep_obj, add_string=''):
|
||||
|
|
|
@ -76,17 +76,18 @@ class PublicHDProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
search_string = {'Season': []}
|
||||
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX -SXXE
|
||||
search_string['Season'].append(ep_string)
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' Season ' + str(ep_obj.scene_season) #2) showName Season X
|
||||
search_string['Season'].append(ep_string)
|
||||
else:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -103,14 +103,13 @@ class SCCProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -94,14 +94,13 @@ class SpeedCDProvider(generic.TorrentProvider):
|
|||
|
||||
#If Every episode in Season is a wanted Episode then search for Season first
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name +' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -173,17 +173,19 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(allPossibleShowNames(self.show)) if not (ep_obj.show.air_by_date or ep_obj.show.sports) else []:
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' Season ' + str(ep_obj.scene_season) + ' -Ep*' #2) showName Season X
|
||||
search_string['Season'].append(ep_string)
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -121,14 +121,13 @@ class TorrentDayProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -98,14 +98,13 @@ class TorrentLeechProvider(generic.TorrentProvider):
|
|||
def _get_season_search_strings(self, ep_obj):
|
||||
|
||||
search_string = {'Season': []}
|
||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
||||
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
|
||||
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]
|
||||
else:
|
||||
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) #1) showName SXX
|
||||
search_string['Season'].append(ep_string)
|
||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||
|
||||
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||
search_string['Season'].append(ep_string)
|
||||
|
||||
return [search_string]
|
||||
|
||||
|
|
|
@ -119,7 +119,10 @@ def makeSceneSeasonSearchString(show, ep_obj, extraSearchType=None):
|
|||
[show.indexerid])
|
||||
numseasons = int(numseasonsSQlResult[0][0])
|
||||
|
||||
seasonStrings = ["S%02d" % int(ep_obj.scene_season)]
|
||||
if show.air_by_date or show.sports:
|
||||
seasonStrings = [str(ep_obj.airdate)[:7]]
|
||||
else:
|
||||
seasonStrings = ["S%02d" % int(ep_obj.scene_season)]
|
||||
|
||||
showNames = set(makeSceneShowSearchStrings(show))
|
||||
|
||||
|
|
Loading…
Reference in a new issue