mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-04 10:23:37 +00:00
Fixes more issues that were still present for season pack searches and air-by-date shows.
This commit is contained in:
parent
3ba3a74fd0
commit
b349bab569
17 changed files with 44 additions and 35 deletions
|
@ -194,6 +194,7 @@ class BTNProvider(generic.TorrentProvider):
|
||||||
search_params = []
|
search_params = []
|
||||||
|
|
||||||
name_exceptions = scene_exceptions.get_scene_exceptions(self.show.indexerid) + [self.show.name]
|
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:
|
for name in name_exceptions:
|
||||||
|
|
||||||
current_params = {}
|
current_params = {}
|
||||||
|
@ -207,17 +208,14 @@ class BTNProvider(generic.TorrentProvider):
|
||||||
current_params['series'] = sanitizeSceneName(name)
|
current_params['series'] = sanitizeSceneName(name)
|
||||||
|
|
||||||
# Search for entire seasons: no need to do special things for air by date shows
|
# Search for entire seasons: no need to do special things for air by date shows
|
||||||
if not (ep_obj.show.air_by_date or ep_obj.show.sports):
|
|
||||||
whole_season_params = current_params.copy()
|
whole_season_params = current_params.copy()
|
||||||
whole_season_params['category'] = 'Season'
|
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)
|
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_params.append(whole_season_params)
|
||||||
|
|
||||||
# Search for episodes in the season
|
|
||||||
current_params = {}
|
|
||||||
current_params['name'] = self._get_episode_search_strings(ep_obj)[0]['name']
|
|
||||||
search_params.append(current_params)
|
|
||||||
|
|
||||||
return search_params
|
return search_params
|
||||||
|
|
||||||
def _get_episode_search_strings(self, ep_obj, add_string=''):
|
def _get_episode_search_strings(self, ep_obj, add_string=''):
|
||||||
|
|
|
@ -83,7 +83,7 @@ class EZRSSProvider(generic.TorrentProvider):
|
||||||
else:
|
else:
|
||||||
params['season'] = self._get_episode_search_strings(ep_obj)[0]['season']
|
params['season'] = self._get_episode_search_strings(ep_obj)[0]['season']
|
||||||
|
|
||||||
params['episode'] = self._get_episode_search_strings(ep_obj)[0]['episode']
|
#params['episode'] = self._get_episode_search_strings(ep_obj)[0]['episode']
|
||||||
|
|
||||||
return [params]
|
return [params]
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,7 @@ class GenericProvider:
|
||||||
|
|
||||||
return (title, url)
|
return (title, url)
|
||||||
|
|
||||||
def findSearchResults(self, show, season, episodes, manualSearch=False):
|
def findSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||||
|
|
||||||
self._checkAuth()
|
self._checkAuth()
|
||||||
self.show = show
|
self.show = show
|
||||||
|
@ -268,6 +268,12 @@ class GenericProvider:
|
||||||
else:
|
else:
|
||||||
logger.log(u'Searching "%s" for "%s" as "%s"' % (self.name, epObj.prettyName(), epObj.prettySceneName()))
|
logger.log(u'Searching "%s" for "%s" as "%s"' % (self.name, epObj.prettyName(), epObj.prettySceneName()))
|
||||||
|
|
||||||
|
# get our season pack search results
|
||||||
|
if seasonSearch:
|
||||||
|
for curString in self._get_episode_search_strings(epObj):
|
||||||
|
itemList += self._doSearch(curString)
|
||||||
|
|
||||||
|
# get our season/episode search results
|
||||||
for curString in self._get_episode_search_strings(epObj):
|
for curString in self._get_episode_search_strings(epObj):
|
||||||
itemList += self._doSearch(curString)
|
itemList += self._doSearch(curString)
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ class KATProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ class NewznabProvider(generic.NZBProvider):
|
||||||
if 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'] = self._get_episode_search_strings(ep_obj)[0]['season']
|
cur_params['season'] = self._get_episode_search_strings(ep_obj)[0]['season']
|
||||||
|
|
||||||
cur_params['episode'] = self._get_episode_search_strings(ep_obj)[0]['ep']
|
#cur_params['episode'] = self._get_episode_search_strings(ep_obj)[0]['ep']
|
||||||
|
|
||||||
to_return.append(cur_params)
|
to_return.append(cur_params)
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ class NextGenProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ class PublicHDProvider(generic.TorrentProvider):
|
||||||
else:
|
else:
|
||||||
search_string['Season'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
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['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ class SCCProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -101,8 +101,7 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
#Building the search string with the episodes we need
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
|
||||||
elif ep_obj.show.air_by_date or ep_obj.show.sports:
|
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'] = self._get_episode_search_strings(ep_obj)[0]['Season']
|
||||||
|
|
||||||
search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
#search_string['Episode'] = self._get_episode_search_strings(ep_obj)[0]['Episode']
|
||||||
|
|
||||||
return [search_string]
|
return [search_string]
|
||||||
|
|
||||||
|
|
|
@ -363,7 +363,7 @@ def filterSearchResults(show, results):
|
||||||
|
|
||||||
return foundResults
|
return foundResults
|
||||||
|
|
||||||
def searchProviders(show, season, episodes, manualSearch=False):
|
def searchProviders(show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||||
logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))
|
logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))
|
||||||
foundResults = {}
|
foundResults = {}
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ def searchProviders(show, season, episodes, manualSearch=False):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
curResults = curProvider.findSearchResults(show, season, episodes, manualSearch)
|
curResults = curProvider.findSearchResults(show, season, episodes, seasonSearch, manualSearch)
|
||||||
except exceptions.AuthException, e:
|
except exceptions.AuthException, e:
|
||||||
logger.log(u"Authentication error: " + ex(e), logger.ERROR)
|
logger.log(u"Authentication error: " + ex(e), logger.ERROR)
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -186,6 +186,7 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
||||||
self.show = show
|
self.show = show
|
||||||
self.segment = segment
|
self.segment = segment
|
||||||
self.wantedEpisodes = []
|
self.wantedEpisodes = []
|
||||||
|
self.seasonSearch = False
|
||||||
|
|
||||||
logger.log(u"Seeing if we need any episodes from " + self.show.name + " season " + str(self.segment))
|
logger.log(u"Seeing if we need any episodes from " + self.show.name + " season " + str(self.segment))
|
||||||
|
|
||||||
|
@ -212,11 +213,16 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
||||||
anyQualities, bestQualities = common.Quality.splitQuality(self.show.quality) #@UnusedVariable
|
anyQualities, bestQualities = common.Quality.splitQuality(self.show.quality) #@UnusedVariable
|
||||||
self.wantedEpisodes = self._need_any_episodes(statusResults, bestQualities)
|
self.wantedEpisodes = self._need_any_episodes(statusResults, bestQualities)
|
||||||
|
|
||||||
|
# check if we want to search for season packs instead of just season/episode
|
||||||
|
seasonEps = show.getAllEpisodes(self.segment)
|
||||||
|
if len(seasonEps) == len(self.wantedEpisodes):
|
||||||
|
self.seasonSearch = True
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
|
|
||||||
generic_queue.QueueItem.execute(self)
|
generic_queue.QueueItem.execute(self)
|
||||||
|
|
||||||
results = search.searchProviders(self.show, self.segment, self.wantedEpisodes)
|
results = search.searchProviders(self.show, self.segment, self.wantedEpisodes, seasonSearch=self.seasonSearch)
|
||||||
|
|
||||||
# download whatever we find
|
# download whatever we find
|
||||||
for curResult in results:
|
for curResult in results:
|
||||||
|
|
|
@ -926,7 +926,7 @@ class ConfigGeneral:
|
||||||
sickbeard.ROOT_DIRS = rootDirString
|
sickbeard.ROOT_DIRS = rootDirString
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def saveAddShowDefaults(self, defaultFlattenFolders, defaultStatus, anyQualities, bestQualities, subtitles=False):
|
def saveAddShowDefaults(self, defaultStatus, anyQualities, bestQualities, defaultFlattenFolders, subtitles=False):
|
||||||
|
|
||||||
if anyQualities:
|
if anyQualities:
|
||||||
anyQualities = anyQualities.split(',')
|
anyQualities = anyQualities.split(',')
|
||||||
|
|
Loading…
Reference in a new issue