Fix for air dates in TVRage API code

This commit is contained in:
echel0n 2014-03-21 10:26:22 -07:00
parent f3c33279b5
commit 108df09382

View file

@ -395,7 +395,7 @@ class TVRage:
if elm.tag in 'firstaired': if elm.tag in 'firstaired':
try: try:
elm.text = re.sub("(0{4})([-]0{2}){1,}", str(dt.date.fromordinal(1)), elm.text) if elm.text is "0000-00-00": elm.text = str(dt.date.fromordinal(1))
elm.text = re.sub("([-]0{2}){1,}", "", elm.text) elm.text = re.sub("([-]0{2}){1,}", "", elm.text)
fixDate = parse(elm.text, fuzzy=True).date() fixDate = parse(elm.text, fuzzy=True).date()
elm.text = fixDate.strftime("%Y-%m-%d") elm.text = fixDate.strftime("%Y-%m-%d")