mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-07 11:58:01 -05:00
Bugfix in date code for TVRage.
This commit is contained in:
parent
33cf136487
commit
1cb293f3d6
@ -577,12 +577,17 @@ class TVRage:
|
|||||||
|
|
||||||
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:
|
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")
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
fixDate = dt.datetime.strptime(curInfo.text,"%b/%Y")
|
||||||
|
newDate = fixDate.replace(day=01)
|
||||||
|
value = newDate.strftime("%Y-%m-%d")
|
||||||
|
except:
|
||||||
|
fixDate = dt.datetime.strptime(curInfo.text,"%Y")
|
||||||
|
newDate = fixDate.replace(month=01, day=01)
|
||||||
|
value = newDate.strftime("%Y-%m-%d")
|
||||||
else:
|
else:
|
||||||
value = curInfo.text
|
value = curInfo.text
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user