From a6f4db0f25f1d2e891562c96fc24964f76558e1c Mon Sep 17 00:00:00 2001 From: Michael Shavit Date: Sat, 25 Jan 2020 23:46:50 -0500 Subject: [PATCH] Fix bug where last_created is incorectly set in the SyncToken. --- cps/kobo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/kobo.py b/cps/kobo.py index 7e1cbc8e..b1bac082 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -120,7 +120,7 @@ def HandleSyncRequest(): changed_entries = ( db.session.query(db.Books) .join(db.Data) - .filter(func.datetime(db.Books.last_modified) != sync_token.books_last_modified) + .filter(func.datetime(db.Books.last_modified) > sync_token.books_last_modified) .filter(db.Data.format.in_(KOBO_FORMATS)) .all() ) @@ -138,7 +138,7 @@ def HandleSyncRequest(): new_books_last_modified = max( book.last_modified, sync_token.books_last_modified ) - new_books_last_created = max(book.timestamp, sync_token.books_last_modified) + new_books_last_created = max(book.timestamp, sync_token.books_last_created) sync_token.books_last_created = new_books_last_created sync_token.books_last_modified = new_books_last_modified