mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Fix for issues downloading season packs and episodes and multiples of the same episode.
This commit is contained in:
parent
7ca19b88d6
commit
a2a608ed85
@ -256,6 +256,9 @@ class GenericProvider:
|
|||||||
results = {}
|
results = {}
|
||||||
|
|
||||||
for epObj in episodes:
|
for epObj in episodes:
|
||||||
|
scene_season = epObj.scene_season
|
||||||
|
scene_episode = epObj.scene_episode
|
||||||
|
|
||||||
cacheResult = self.cache.searchCache(epObj, manualSearch)
|
cacheResult = self.cache.searchCache(epObj, manualSearch)
|
||||||
if len(cacheResult):
|
if len(cacheResult):
|
||||||
return cacheResult
|
return cacheResult
|
||||||
@ -279,9 +282,14 @@ class GenericProvider:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if not (self.show.air_by_date or self.show.sports):
|
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):
|
if not parse_result.episode_numbers and (parse_result.season_number != None and parse_result.season_number != season) or (
|
||||||
logger.log(u"Episode " + title + " isn't " + str(season) + "x" + str(
|
parse_result.season_number == None and season != 1):
|
||||||
epObj.episode) + ", skipping it", logger.DEBUG)
|
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
|
continue
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -317,7 +325,7 @@ class GenericProvider:
|
|||||||
result.content = None
|
result.content = None
|
||||||
|
|
||||||
if len(epObjs) == 1:
|
if len(epObjs) == 1:
|
||||||
epNum = epObjs[0].episode
|
epNum = epObj.episode
|
||||||
logger.log(u"Single episode result.", logger.DEBUG)
|
logger.log(u"Single episode result.", logger.DEBUG)
|
||||||
elif len(epObjs) > 1:
|
elif len(epObjs) > 1:
|
||||||
epNum = MULTI_EP_RESULT
|
epNum = MULTI_EP_RESULT
|
||||||
@ -333,6 +341,9 @@ class GenericProvider:
|
|||||||
else:
|
else:
|
||||||
results[epNum] = [result]
|
results[epNum] = [result]
|
||||||
|
|
||||||
|
# remove duplicate results
|
||||||
|
results[epNum] = list(set(results[epNum]))
|
||||||
|
|
||||||
# found the result we wanted
|
# found the result we wanted
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user