mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
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:
parent
6cfd09a8b8
commit
d6c563e881
@ -31,24 +31,45 @@ void SyncControllerV2::service(HttpRequest &request, HttpResponse &response)
|
|||||||
|
|
||||||
if(comicInfoProgress.length() == 4 || comicInfoProgress.length() == 5)
|
if(comicInfoProgress.length() == 4 || comicInfoProgress.length() == 5)
|
||||||
{
|
{
|
||||||
libraryId = comicInfoProgress.at(0).toULongLong();
|
if (comicInfoProgress.at(0) == "unknown")
|
||||||
comicId = comicInfoProgress.at(1).toULongLong();
|
|
||||||
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
|
|
||||||
info.id = comicId;
|
|
||||||
|
|
||||||
//Client 2.1+ version
|
|
||||||
if(comicInfoProgress.length() > 4)
|
|
||||||
{
|
{
|
||||||
currentRating = comicInfoProgress.at(4).toInt();
|
libraryId = comicInfoProgress.at(0).toULongLong();
|
||||||
info.rating = currentRating;
|
comicId = comicInfoProgress.at(1).toULongLong();
|
||||||
}
|
hash = comicInfoProgress.at(2);
|
||||||
|
currentPage = comicInfoProgress.at(3).toInt();
|
||||||
|
|
||||||
DBHelper::updateFromRemoteClient(libraryId,info);
|
ComicInfo info;
|
||||||
|
info.currentPage = currentPage;
|
||||||
|
info.hash = hash; //TODO remove the hash check and add UUIDs for libraries
|
||||||
|
info.id = comicId;
|
||||||
|
|
||||||
|
//Client 2.1+ version
|
||||||
|
if(comicInfoProgress.length() > 4)
|
||||||
|
{
|
||||||
|
currentRating = comicInfoProgress.at(4).toInt();
|
||||||
|
info.rating = currentRating;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user