1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 19:12:26 -05:00

Fix for issues downloading season packs and episodes and multiples of the same episode.

This commit is contained in:
echel0n 2014-05-03 16:56:01 -07:00
parent 7ca19b88d6
commit a2a608ed85

View File

@ -256,6 +256,9 @@ class GenericProvider:
results = {}
for epObj in episodes:
scene_season = epObj.scene_season
scene_episode = epObj.scene_episode
cacheResult = self.cache.searchCache(epObj, manualSearch)
if len(cacheResult):
return cacheResult
@ -279,9 +282,14 @@ class GenericProvider:
continue
if not (self.show.air_by_date or self.show.sports):
if (parse_result.season_number != season or epObj.episode not in parse_result.episode_numbers):
logger.log(u"Episode " + title + " isn't " + str(season) + "x" + str(
epObj.episode) + ", skipping it", logger.DEBUG)
if not parse_result.episode_numbers and (parse_result.season_number != None and parse_result.season_number != season) or (
parse_result.season_number == None and season != 1):
logger.log(u"The result " + title + " doesn't seem to be a valid season for season " + str(
season) + ", ignoring", logger.DEBUG)
continue
elif len(parse_result.episode_numbers) and (parse_result.season_number != scene_season or scene_episode not in parse_result.episode_numbers):
logger.log(u"Episode " + title + " isn't " + str(scene_season) + "x" + str(
scene_episode) + ", skipping it", logger.DEBUG)
continue
else:
@ -317,7 +325,7 @@ class GenericProvider:
result.content = None
if len(epObjs) == 1:
epNum = epObjs[0].episode
epNum = epObj.episode
logger.log(u"Single episode result.", logger.DEBUG)
elif len(epObjs) > 1:
epNum = MULTI_EP_RESULT
@ -333,6 +341,9 @@ class GenericProvider:
else:
results[epNum] = [result]
# remove duplicate results
results[epNum] = list(set(results[epNum]))
# found the result we wanted
break