From 04f0d22563f90ca49f713dad6bb4cd60e25c8fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 13 Jan 2024 17:19:20 +0100 Subject: [PATCH] Fix "more recent" calculation in the server side All comics received were being sent back if they were already opened --- YACReaderLibrary/db_helper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index bad74177..a82fd48a 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -1063,13 +1063,18 @@ QMap> DBHelper::updateFromRemoteClient(const QMap comicInfo.id contains comic id ComicDB comic = DBHelper::loadComic(comicInfo.id, db, found); if (comic.info.hash == comicInfo.hash) { bool isMoreRecent = false; // completion takes precedence over lastTimeOpened, if we just want to synchronize the lastest status we should use only lastTimeOpened - if ((comic.info.currentPage > 1 && comic.info.currentPage > comicInfo.currentPage) || comic.info.hasBeenOpened || (comic.info.read && !comicInfo.read)) { + if ((comic.info.currentPage > 1 && comic.info.currentPage > comicInfo.currentPage) || (comic.info.read && !comicInfo.read)) { + isMoreRecent = true; + } + + if (comic.info.hasBeenOpened && comic.info.currentPage > comicInfo.currentPage) { isMoreRecent = true; }