Fixed bug in backlog search for wanted and failed statuses, was improperly loading our segment lists and dicts.

This commit is contained in:
echel0n 2014-04-25 01:17:32 -07:00
parent d8428b515d
commit 08f67e09de
1 changed files with 11 additions and 4 deletions

View File

@ -3123,15 +3123,22 @@ class Home:
if epObj is None:
return _genericMessage("Error", "Episode couldn't be retrieved")
if int(status) in (WANTED, FAILED):
if int(status) == WANTED:
# figure out what episodes are wanted so we can backlog them
if epObj.show.air_by_date:
wanted_segments.append(str(epObj.airdate)[:7])
segment = str(epObj.airdate)[:7]
else:
wanted_segments.append(epObj.season)
segment = epObj.season
if segment not in wanted_segments:
wanted_segments.append(segment)
elif int(status) == FAILED:
# figure out what episodes failed so we can retry them
failed_segments.setdefault(epObj.season, []).append(epObj.episode)
if epObj.season not in failed_segments:
failed_segments[epObj.season] = []
if epObj.episode not in failed_segments[epObj.season]:
failed_segments[epObj.season].append(epObj.episode)
with epObj.lock:
# don't let them mess up UNAIRED episodes