1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-10 11:25:05 -05:00

Fix for firstaired dates as they are inconsistant in format on TVRage

This commit is contained in:
echel0n 2014-03-10 17:28:28 -07:00
parent f6e3ee1ef2
commit 33cf136487

View File

@ -576,8 +576,13 @@ class TVRage:
tag = curInfo.tag.lower()
if curInfo.tag.lower() in ('started', 'ended') and curInfo.text is not None:
fixDate = dt.datetime.strptime(curInfo.text,"%b/%d/%Y")
value = fixDate.strftime("%Y-%m-%d")
try:
fixDate = dt.datetime.strptime(curInfo.text,"%b/%Y")
newDate = fixDate.replace(day=01)
value = newDate.strftime("%Y-%m-%d")
except Exception:
fixDate = dt.datetime.strptime(curInfo.text,"%b/%d/%Y")
value = fixDate.strftime("%Y-%m-%d")
else:
value = curInfo.text