mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Fix "more recent" calculation in the server side
All comics received were being sent back if they were already opened
This commit is contained in:
parent
e26169386c
commit
04f0d22563
@ -1063,13 +1063,18 @@ QMap<qulonglong, QList<ComicDB>> DBHelper::updateFromRemoteClient(const QMap<qul
|
||||
|
||||
foreach (ComicInfo comicInfo, comics[libraryId]) {
|
||||
bool found;
|
||||
// TODO: sanitize this -> 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user