mirror of
https://github.com/moparisthebest/SickRage
synced 2024-08-13 16:53:54 -04:00
Fix for firstaired dates as they are inconsistant in format on TVRage
This commit is contained in:
parent
f6e3ee1ef2
commit
33cf136487
@ -576,6 +576,11 @@ class TVRage:
|
|||||||
tag = curInfo.tag.lower()
|
tag = curInfo.tag.lower()
|
||||||
|
|
||||||
if curInfo.tag.lower() in ('started', 'ended') and curInfo.text is not None:
|
if curInfo.tag.lower() in ('started', 'ended') and curInfo.text is not None:
|
||||||
|
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")
|
fixDate = dt.datetime.strptime(curInfo.text,"%b/%d/%Y")
|
||||||
value = fixDate.strftime("%Y-%m-%d")
|
value = fixDate.strftime("%Y-%m-%d")
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user