1
0
Fork 0

fix: timestamp comparison in to_json function

This commit is contained in:
apkallum 2020-07-14 10:26:33 -04:00
parent 175e6fa3d0
commit 98dda68897

View file

@ -190,7 +190,10 @@ class Link:
for key, val in json_info.items() for key, val in json_info.items()
if key in cls.field_names() if key in cls.field_names()
} }
info['updated'] = parse_date(info.get('updated')) try:
info['updated'] = int(parse_date(info.get('updated'))) # Cast to int which comes with rounding down
except (ValueError, TypeError):
info['updated'] = None
info['sources'] = info.get('sources') or [] info['sources'] = info.get('sources') or []
json_history = info.get('history') or {} json_history = info.get('history') or {}