Merge pull request #611 from JackDandy/port_fix_change_setting_episode_status

Port fix change setting episode status
This commit is contained in:
echel0n 2014-06-19 09:47:25 -07:00
commit 0499d5b6aa

View file

@ -1641,8 +1641,8 @@ class TVEpisode(object):
self.deleteEpisode() self.deleteEpisode()
return False return False
# don't update show status if show dir is missing, unless missing show dirs are created during post-processing # don't update show status if show dir is missing, unless it's missing on purpose
if not ek.ek(os.path.isdir, self.show._location) and not sickbeard.CREATE_MISSING_SHOW_DIRS: if not ek.ek(os.path.isdir, self.show._location) and not sickbeard.CREATE_MISSING_SHOW_DIRS and not sickbeard.ADD_SHOWS_WO_DIR:
logger.log( logger.log(
u"The show dir is missing, not bothering to change the episode statuses since it'd probably be invalid") u"The show dir is missing, not bothering to change the episode statuses since it'd probably be invalid")
return return
@ -1651,15 +1651,14 @@ class TVEpisode(object):
logger.log(str(self.show.indexerid) + u": Setting status for " + str(season) + "x" + str( logger.log(str(self.show.indexerid) + u": Setting status for " + str(season) + "x" + str(
episode) + " based on status " + str(self.status) + " and existence of " + self.location, logger.DEBUG) episode) + " based on status " + str(self.status) + " and existence of " + self.location, logger.DEBUG)
# if we don't have the file
if not ek.ek(os.path.isfile, self.location): if not ek.ek(os.path.isfile, self.location):
# if we don't have the file # if it hasn't aired yet set the status to UNAIRED
if self.airdate >= datetime.date.today() and self.status not in Quality.SNATCHED + Quality.SNATCHED_PROPER: if self.airdate >= datetime.date.today() and self.status in [SKIPPED, UNAIRED, UNKNOWN, WANTED]:
# and it hasn't aired yet set the status to UNAIRED logger.log(u"Episode airs in the future, marking it " + str(UNAIRED), logger.DEBUG)
logger.log(
u"Episode airs in the future, changing status from " + str(self.status) + " to " + str(UNAIRED),
logger.DEBUG)
self.status = UNAIRED self.status = UNAIRED
# if there's no airdate then set it to skipped (and respect ignored) # if there's no airdate then set it to skipped (and respect ignored)
elif self.airdate == datetime.date.fromordinal(1): elif self.airdate == datetime.date.fromordinal(1):
if self.status == IGNORED: if self.status == IGNORED:
@ -1667,6 +1666,7 @@ class TVEpisode(object):
else: else:
logger.log(u"Episode has no air date, automatically marking it skipped", logger.DEBUG) logger.log(u"Episode has no air date, automatically marking it skipped", logger.DEBUG)
self.status = SKIPPED self.status = SKIPPED
# if we don't have the file and the airdate is in the past # if we don't have the file and the airdate is in the past
else: else:
if self.status == UNAIRED: if self.status == UNAIRED: