From e77d61300235e4cf09fca26752569854b1a8050c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Mon, 21 May 2018 22:13:07 +0200 Subject: [PATCH] Update last time opened when updating reading progress from ios client. --- YACReaderLibrary/db_helper.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index df81d4c7..697d0bd0 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -759,6 +759,9 @@ void DBHelper::updateFromRemoteClient(qulonglong libraryId,const ComicInfo & com comic.info.read = true; comic.info.hasBeenOpened = true; + + if (comic.info.lastTimeOpened.toULongLong() < comicInfo.lastTimeOpened.toULongLong()) + comic.info.lastTimeOpened = comicInfo.lastTimeOpened; } if(comicInfo.rating > 0) @@ -794,6 +797,9 @@ void DBHelper::updateFromRemoteClientWithHash(const ComicInfo & comicInfo) info.lastTimeOpened = QDateTime::currentSecsSinceEpoch(); info.hasBeenOpened = true; + + if (info.lastTimeOpened.toULongLong() < comicInfo.lastTimeOpened.toULongLong()) + info.lastTimeOpened = comicInfo.lastTimeOpened; } if(comicInfo.rating > 0)