mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 19:12:26 -05:00
Merge pull request #825 from KontiSR/fix_seasonpacks_testpls
Season pack fix attempt #1
This commit is contained in:
commit
761192e275
@ -334,11 +334,19 @@ class GenericProvider:
|
|||||||
|
|
||||||
addCacheEntry = False
|
addCacheEntry = False
|
||||||
if not (showObj.air_by_date or showObj.sports):
|
if not (showObj.air_by_date or showObj.sports):
|
||||||
if search_mode == 'sponly' and len(parse_result.episode_numbers):
|
if search_mode == 'sponly':
|
||||||
|
if len(parse_result.episode_numbers):
|
||||||
logger.log(
|
logger.log(
|
||||||
u"This is supposed to be a season pack search but the result " + title + " is not a valid season pack, skipping it",
|
u"This is supposed to be a season pack search but the result " + title + " is not a valid season pack, skipping it",
|
||||||
logger.DEBUG)
|
logger.DEBUG)
|
||||||
addCacheEntry = True
|
addCacheEntry = True
|
||||||
|
if len(parse_result.episode_numbers) and (
|
||||||
|
parse_result.season_number not in set([ep.season for ep in episodes]) or not [ep for ep in episodes if
|
||||||
|
ep.scene_episode in parse_result.episode_numbers]):
|
||||||
|
logger.log(
|
||||||
|
u"The result " + title + " doesn't seem to be a valid episode that we are trying to snatch, ignoring",
|
||||||
|
logger.DEBUG)
|
||||||
|
addCacheEntry = True
|
||||||
else:
|
else:
|
||||||
if not len(parse_result.episode_numbers) and parse_result.season_number and not [ep for ep in
|
if not len(parse_result.episode_numbers) and parse_result.season_number and not [ep for ep in
|
||||||
episodes if
|
episodes if
|
||||||
|
@ -533,7 +533,8 @@ def searchProviders(show, episodes, manualSearch=False):
|
|||||||
|
|
||||||
# see if every episode is wanted
|
# see if every episode is wanted
|
||||||
if bestSeasonResult:
|
if bestSeasonResult:
|
||||||
|
searchedSeasons = []
|
||||||
|
searchedSeasons = [str(x.season) for x in episodes]
|
||||||
# get the quality of the season nzb
|
# get the quality of the season nzb
|
||||||
seasonQual = bestSeasonResult.quality
|
seasonQual = bestSeasonResult.quality
|
||||||
logger.log(
|
logger.log(
|
||||||
@ -541,14 +542,17 @@ def searchProviders(show, episodes, manualSearch=False):
|
|||||||
seasonQual], logger.DEBUG)
|
seasonQual], logger.DEBUG)
|
||||||
|
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
allEps = [int(x["episode"]) for x in
|
allEps = [int(x["episode"])
|
||||||
myDB.select("SELECT episode FROM tv_episodes WHERE showid = ? AND season = ?",
|
for x in myDB.select("SELECT episode FROM tv_episodes WHERE showid = ? AND ( season IN ( " + ','.join(searchedSeasons) + " ) )",
|
||||||
[show.indexerid, season])]
|
[show.indexerid])]
|
||||||
|
|
||||||
|
logger.log(u"Executed query: [SELECT episode FROM tv_episodes WHERE showid = %s AND season in %s]" % (show.indexerid, ','.join(searchedSeasons)))
|
||||||
logger.log(u"Episode list: " + str(allEps), logger.DEBUG)
|
logger.log(u"Episode list: " + str(allEps), logger.DEBUG)
|
||||||
|
|
||||||
allWanted = True
|
allWanted = True
|
||||||
anyWanted = False
|
anyWanted = False
|
||||||
for curEpNum in allEps:
|
for curEpNum in allEps:
|
||||||
|
for season in set([x.season for x in episodes]):
|
||||||
if not show.wantEpisode(season, curEpNum, seasonQual):
|
if not show.wantEpisode(season, curEpNum, seasonQual):
|
||||||
allWanted = False
|
allWanted = False
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user