From 5027aeb3a0ea833d7ca87668f05ebb925bf6e436 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 57ef1ab5..f1533580 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -130,7 +130,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)) .filter(db.Books.id.notin_(archived_book_ids)) .all() @@ -149,7 +149,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