From 98dda688970c8993a7a79847ea74ff5e30964b4f Mon Sep 17 00:00:00 2001 From: apkallum Date: Tue, 14 Jul 2020 10:26:33 -0400 Subject: [PATCH] fix: timestamp comparison in to_json function --- archivebox/index/schema.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/archivebox/index/schema.py b/archivebox/index/schema.py index db17c269..eb6ef894 100644 --- a/archivebox/index/schema.py +++ b/archivebox/index/schema.py @@ -190,7 +190,10 @@ class Link: for key, val in json_info.items() 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 [] json_history = info.get('history') or {}