mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-04 18:33:38 +00:00
Merge pull request #777 from JackDandy/feature/FixStatusReset
Fix status reset of a snatched, downloaded, or archived episode when …
This commit is contained in:
commit
4a4afdaa01
2 changed files with 26 additions and 21 deletions
|
@ -164,6 +164,8 @@
|
||||||
* Change when using "Add new show" reduce search time outs
|
* Change when using "Add new show" reduce search time outs
|
||||||
* Change always allow incomplete show data
|
* Change always allow incomplete show data
|
||||||
* Remove redundant config/general/"Allow incomplete show data"
|
* Remove redundant config/general/"Allow incomplete show data"
|
||||||
|
* Fix status reset of a snatched, downloaded, or archived episode when its date is set to never (no date) on the info
|
||||||
|
source and there is no media file
|
||||||
|
|
||||||
[develop changelog]
|
[develop changelog]
|
||||||
* Change send nzb data to NZBGet for Anizb instead of url
|
* Change send nzb data to NZBGet for Anizb instead of url
|
||||||
|
|
|
@ -1836,6 +1836,7 @@ class TVEpisode(object):
|
||||||
# if we don't have the file
|
# 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 self.status in [SKIPPED, UNAIRED, UNKNOWN, WANTED]:
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
delta = datetime.timedelta(days=1)
|
delta = datetime.timedelta(days=1)
|
||||||
show_time = network_timezones.parse_date_time(self.airdate.toordinal(), self.show.airs, self.show.network)
|
show_time = network_timezones.parse_date_time(self.airdate.toordinal(), self.show.airs, self.show.network)
|
||||||
|
@ -1845,7 +1846,7 @@ class TVEpisode(object):
|
||||||
(not self.airdate < (today - delta) and ((show_time + show_length) > tz_now)))
|
(not self.airdate < (today - delta) and ((show_time + show_length) > tz_now)))
|
||||||
|
|
||||||
# if this episode hasn't aired yet set the status to UNAIRED
|
# if this episode hasn't aired yet set the status to UNAIRED
|
||||||
if future_airtime and self.status in [SKIPPED, UNAIRED, UNKNOWN, WANTED]:
|
if future_airtime:
|
||||||
msg = 'Episode airs in the future, marking it %s'
|
msg = 'Episode airs in the future, marking it %s'
|
||||||
self.status = UNAIRED
|
self.status = UNAIRED
|
||||||
|
|
||||||
|
@ -1858,8 +1859,7 @@ class TVEpisode(object):
|
||||||
self.status = UNAIRED
|
self.status = UNAIRED
|
||||||
|
|
||||||
# if the airdate is in the past
|
# if the airdate is in the past
|
||||||
else:
|
elif UNAIRED == self.status:
|
||||||
if UNAIRED == self.status:
|
|
||||||
msg = ('Episode status %s%s, with air date in the past, marking it ' % (
|
msg = ('Episode status %s%s, with air date in the past, marking it ' % (
|
||||||
statusStrings[self.status], ','.join([(' is a special', '')[0 < self.season],
|
statusStrings[self.status], ','.join([(' is a special', '')[0 < self.season],
|
||||||
('', ' is paused')[self.show.paused]])) + '%s')
|
('', ' is paused')[self.show.paused]])) + '%s')
|
||||||
|
@ -1876,6 +1876,9 @@ class TVEpisode(object):
|
||||||
else:
|
else:
|
||||||
msg = 'Not touching episode status %s, with air date in the past, because there is no file'
|
msg = 'Not touching episode status %s, with air date in the past, because there is no file'
|
||||||
|
|
||||||
|
else:
|
||||||
|
msg = 'Not touching episode status %s, because there is no file'
|
||||||
|
|
||||||
logger.log(msg % statusStrings[self.status], logger.DEBUG)
|
logger.log(msg % statusStrings[self.status], logger.DEBUG)
|
||||||
|
|
||||||
# if we have a media file then it's downloaded
|
# if we have a media file then it's downloaded
|
||||||
|
|
Loading…
Reference in a new issue