diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index 192371a..6d52517 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -5,6 +5,9 @@ import Queue import json +import datetime +from dateutil import parser + #from mutagen import File #from mutagen.mp4 import MP4 #from mutagen.id3 import ID3 @@ -137,7 +140,9 @@ def Log(self, message, *args): def getDateFromString(self, string): try: - return Datetime.ParseDate(string).date() + if not len(string): return None + DEFAULT_DATE = datetime.datetime(datetime.MINYEAR, 1, 1) + return parser.parse(string, default=DEFAULT_DATE).date() except: return None @@ -237,7 +242,9 @@ def Log(self, message, *args): def getDateFromString(self, string): try: - return Datetime.ParseDate(string).date() + if not len(string): return None + DEFAULT_DATE = datetime.datetime(datetime.MINYEAR, 1, 1) + return parser.parse(string, default=DEFAULT_DATE).date() except: return None