rclaudio: catch exception when parsing bad date, set date to the epoch
This commit is contained in:
parent
f2407c3394
commit
31f6793495
@ -255,6 +255,7 @@ class AudioTagExtractor(RclBaseHandler):
|
||||
# was wrong, because dmtime is the unix integer time. We have
|
||||
# removed the alias, and set dmtime from the parsed date value.
|
||||
def parsedate(self, dt):
|
||||
try:
|
||||
dt = dt.decode('utf-8', errors='ignore')
|
||||
if len(dt) > 10:
|
||||
dt = dt[0:10]
|
||||
@ -267,6 +268,8 @@ class AudioTagExtractor(RclBaseHandler):
|
||||
pdt = datetime.datetime.strptime(dt, "%Y-%m-%d")
|
||||
val = time.mktime(pdt.timetuple())
|
||||
return "%d" % val
|
||||
except:
|
||||
return 0
|
||||
|
||||
|
||||
def html_text(self, filename):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user