If a comic doesn't have library and id info, then try to update the info in all the libraries.

This commit is contained in:
Luis Ángel San Martín 2018-05-21 19:52:29 +02:00
parent 6cfd09a8b8
commit d6c563e881

View File

@ -30,6 +30,8 @@ void SyncControllerV2::service(HttpRequest &request, HttpResponse &response)
QList<QString> comicInfoProgress = comicInfo.split("\t"); QList<QString> comicInfoProgress = comicInfo.split("\t");
if(comicInfoProgress.length() == 4 || comicInfoProgress.length() == 5) if(comicInfoProgress.length() == 4 || comicInfoProgress.length() == 5)
{
if (comicInfoProgress.at(0) == "unknown")
{ {
libraryId = comicInfoProgress.at(0).toULongLong(); libraryId = comicInfoProgress.at(0).toULongLong();
comicId = comicInfoProgress.at(1).toULongLong(); comicId = comicInfoProgress.at(1).toULongLong();
@ -50,6 +52,25 @@ void SyncControllerV2::service(HttpRequest &request, HttpResponse &response)
DBHelper::updateFromRemoteClient(libraryId,info); DBHelper::updateFromRemoteClient(libraryId,info);
} }
else
{
hash = comicInfoProgress.at(2);
currentPage = comicInfoProgress.at(3).toInt();
ComicInfo info;
info.currentPage = currentPage;
info.hash = hash; //TODO remove the hash check and add UUIDs for libraries
//Client 2.1+ version
if(comicInfoProgress.length() > 4)
{
currentRating = comicInfoProgress.at(4).toInt();
info.rating = currentRating;
}
DBHelper::updateFromRemoteClientWithHash(info);
}
}
} }
} }
else else