1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-17 14:55:07 -05:00

Fixed global name season error during searches

This commit is contained in:
echel0n 2014-09-06 22:25:01 -07:00
parent 2fbae22f2f
commit 20c0b4ea72

View File

@ -37,6 +37,7 @@ from sickbeard import clients
from hachoir_parser import createParser
class GenericProvider:
NZB = "nzb"
TORRENT = "torrent"
@ -335,16 +336,15 @@ class GenericProvider:
logger.DEBUG)
addCacheEntry = True
else:
if not len(parse_result.episode_numbers) and (
parse_result.season_number and parse_result.season_number != season) or (
not parse_result.season_number and season != 1):
if not len(parse_result.episode_numbers) and parse_result.season_number and not [ep for ep in
episodes if
ep.season == parse_result.season_number and ep.episode in parse_result.episode_numbers]:
logger.log(
u"The result " + title + " doesn't seem to be a valid season that we are trying to snatch, ignoring",
logger.DEBUG)
addCacheEntry = True
elif len(parse_result.episode_numbers) and (
parse_result.season_number != season or not [ep for ep in episodes if
ep.scene_episode in parse_result.episode_numbers]):
elif len(parse_result.episode_numbers) and not [ep for ep in episodes if
ep.season == parse_result.season_number and ep.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)
@ -352,7 +352,7 @@ class GenericProvider:
if not addCacheEntry:
# we just use the existing info for normal searches
actual_season = season
actual_season = parse_result.season_number
actual_episodes = parse_result.episode_numbers
else:
if not (parse_result.is_air_by_date):