1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-25 17:40:31 +00:00

Fix #1702 (invalid timestamps during kobo sync caused by malformed database)

This commit is contained in:
Ozzieisaacs 2020-11-07 12:49:39 +01:00
parent e99dd3310c
commit 58d485cbb5

View File

@ -119,7 +119,11 @@ def redirect_or_proxy_request():
def convert_to_kobo_timestamp_string(timestamp): def convert_to_kobo_timestamp_string(timestamp):
return timestamp.strftime("%Y-%m-%dT%H:%M:%SZ") try:
return timestamp.strftime("%Y-%m-%dT%H:%M:%SZ")
except AttributeError as exc:
log.debug("Timestamp not valid: {}".format(exc))
return datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ")
@kobo.route("/v1/library/sync") @kobo.route("/v1/library/sync")