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