Fix issues getting marked as opened because android minimum current page is 1

This commit is contained in:
Luis Ángel San Martín
2024-02-02 13:04:38 +01:00
parent 08cbb88891
commit 19e45ef9de
4 changed files with 17 additions and 7 deletions

View File

@ -998,7 +998,7 @@ void DBHelper::updateFromRemoteClient(qulonglong libraryId, const ComicInfo &com
QSqlDatabase::removeDatabase(connectionName);
}
QMap<qulonglong, QList<ComicDB>> DBHelper::updateFromRemoteClient(const QMap<qulonglong, QList<ComicInfo>> &comics)
QMap<qulonglong, QList<ComicDB>> DBHelper::updateFromRemoteClient(const QMap<qulonglong, QList<ComicInfo>> &comics, bool clientSendsHasBeenOpened)
{
QMap<qulonglong, QList<ComicDB>> moreRecentComics;
@ -1050,7 +1050,11 @@ QMap<qulonglong, QList<ComicDB>> DBHelper::updateFromRemoteClient(const QMap<qul
comic.info.read = comic.info.read || comicInfo.read;
comic.info.hasBeenOpened = comic.info.hasBeenOpened || comicInfo.currentPage > 0;
if (clientSendsHasBeenOpened) {
comic.info.hasBeenOpened = comic.info.hasBeenOpened || comicInfo.hasBeenOpened; // android
} else {
comic.info.hasBeenOpened = comic.info.hasBeenOpened || comicInfo.currentPage > 0; // ios (legacy)
}
if (comic.info.lastTimeOpened.toULongLong() < comicInfo.lastTimeOpened.toULongLong() && comicInfo.lastTimeOpened.toULongLong() > 0)
comic.info.lastTimeOpened = comicInfo.lastTimeOpened;