From ad564e25ca32e4b831438476415886640a3c1974 Mon Sep 17 00:00:00 2001 From: Michael Shavit Date: Sun, 8 Mar 2020 01:20:54 -0500 Subject: [PATCH] More fixes for Kobo Sync - Fix incorrect maintenance of the Synctoken timestamps. - Fix issue where the SyncToken isn't included in the response when kobo_proxying is disabled. --- cps/kobo.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cps/kobo.py b/cps/kobo.py index 9830f1c2..103da848 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -159,18 +159,14 @@ def HandleSyncRequest(): entitlements.append({"ChangedEntitlement": entitlement}) new_books_last_modified = max( - book.last_modified, sync_token.books_last_modified + book.last_modified, new_books_last_modified ) - new_books_last_created = max(book.timestamp, sync_token.books_last_created) + new_books_last_created = max(book.timestamp, new_books_last_created) sync_token.books_last_created = new_books_last_created sync_token.books_last_modified = new_books_last_modified - if config.config_kobo_proxy: - return generate_sync_response(request, sync_token, entitlements) - - return make_response(jsonify(entitlements)) - # Missing feature: Detect server-side book deletions. + return generate_sync_response(request, sync_token, entitlements) def generate_sync_response(request, sync_token, entitlements):