mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 06:45:05 -05:00
Fixed bug with air dates being malformed
This commit is contained in:
parent
d5053ef8d3
commit
b3662cfb7b
@ -1358,12 +1358,12 @@ class TVEpisode(object):
|
|||||||
|
|
||||||
self.description = getattr(myEp, 'overview', "")
|
self.description = getattr(myEp, 'overview', "")
|
||||||
|
|
||||||
try:
|
firstaired = getattr(myEp, 'firstaired', None)
|
||||||
firstaired = getattr(myEp, 'firstaired', None)
|
if firstaired is None or "0000-00-00":
|
||||||
if firstaired is None: raise ValueError
|
firstaired = str(datetime.date.fromordinal(1))
|
||||||
|
rawAirdate = [int(x) for x in firstaired.split("-")]
|
||||||
|
|
||||||
firstaired = re.sub("(0{4})([-]0{2}){1,}", str(datetime.date.fromordinal(1)), firstaired)
|
try:
|
||||||
rawAirdate = [int(x) for x in firstaired.split("-")]
|
|
||||||
self.airdate = datetime.date(rawAirdate[0], rawAirdate[1], rawAirdate[2])
|
self.airdate = datetime.date(rawAirdate[0], rawAirdate[1], rawAirdate[2])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logger.log(u"Malformed air date retrieved from " + self.indexer + " ("+self.show.name+" - "+str(season)+"x"+str(episode)+")", logger.ERROR)
|
logger.log(u"Malformed air date retrieved from " + self.indexer + " ("+self.show.name+" - "+str(season)+"x"+str(episode)+")", logger.ERROR)
|
||||||
|
Loading…
Reference in New Issue
Block a user