From 31a63d41aaadce944e5cc57e8a3bd70faf4689ee Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 19 Mar 2014 01:34:46 -0700 Subject: [PATCH] Bugfix in failed handler --- sickbeard/failed_history.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sickbeard/failed_history.py b/sickbeard/failed_history.py index a4da667e..2237d143 100644 --- a/sickbeard/failed_history.py +++ b/sickbeard/failed_history.py @@ -23,9 +23,10 @@ import datetime from sickbeard import db from sickbeard import logger -from sickbeard import common from sickbeard import exceptions from sickbeard.history import dateFormat +from sickbeard.common import Quality +from sickbeard.common import WANTED, FAILED def _log_helper(message, level=logger.MESSAGE): @@ -133,7 +134,7 @@ def revertEpisodes(show_obj, season, episodes): ep_obj.status = history_eps[cur_episode]['old_status'] else: log_str += _log_helper(u"WARNING: Episode not found in history. Setting it back to WANTED", logger.WARNING) - ep_obj.status = common.WANTED + ep_obj.status = WANTED ep_obj.saveToDB() else: @@ -147,7 +148,7 @@ def revertEpisodes(show_obj, season, episodes): ep_obj.status = history_eps[ep_obj]['old_status'] else: log_str += _log_helper(u"WARNING: Episode not found in history. Setting it back to WANTED", logger.WARNING) - ep_obj.status = common.WANTED + ep_obj.status = WANTED ep_obj.saveToDB() @@ -163,13 +164,15 @@ def markFailed(show_obj, season, episodes): continue with ep_obj.lock: - ep_obj.status = common.FAILED + quality = Quality.splitCompositeStatus(ep_obj.status)[1] + ep_obj.status = Quality.compositeStatus(FAILED, quality) ep_obj.saveToDB() else: # Whole season for ep_obj in show_obj.getAllEpisodes(season): with ep_obj.lock: - ep_obj.status = common.FAILED + quality = Quality.splitCompositeStatus(ep_obj.status)[1] + ep_obj.status = Quality.compositeStatus(FAILED, quality) ep_obj.saveToDB() return log_str