mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Bugfix in date code for TVRage.
This commit is contained in:
parent
33cf136487
commit
1cb293f3d6
1 changed files with 9 additions and 4 deletions
|
@ -577,12 +577,17 @@ class TVRage:
|
|||
|
||||
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")
|
||||
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:
|
||||
value = curInfo.text
|
||||
|
||||
|
|
Loading…
Reference in a new issue