Add support for storing and serving the new comic filters format

It's already implemented on iOS and next is supporting it on Android.
This commit is contained in:
Luis Ángel San Martín
2025-06-14 09:56:33 +02:00
parent a4ab11d44d
commit b7fb45a331
10 changed files with 191 additions and 40 deletions

View File

@ -34,7 +34,6 @@ void UpdateComicControllerV2::service(HttpRequest &request, HttpResponse &respon
ComicInfo info;
info.currentPage = currentPage;
info.id = comicId;
DBHelper::updateProgress(libraryId, info);
if (data.length() > 1) {
if (data.at(1).isEmpty() == false) {
@ -43,8 +42,23 @@ void UpdateComicControllerV2::service(HttpRequest &request, HttpResponse &respon
info.id = nextComicId.toULongLong();
DBHelper::setComicAsReading(libraryId, info);
}
if (data.length() > 2) {
QStringList imageFiltersData = data.at(2).split("\t");
auto epoch = imageFiltersData.at(0).toULongLong();
QString imageFiltersJson = imageFiltersData.at(1);
ComicInfo imageFiltersInfo;
imageFiltersInfo.id = comicId;
imageFiltersInfo.lastTimeImageFiltersSet = epoch;
imageFiltersInfo.imageFiltersJson = imageFiltersJson.isEmpty() ? QVariant() : imageFiltersJson;
DBHelper::updateImageFilters(libraryId, imageFiltersInfo);
}
}
DBHelper::updateProgress(libraryId, info);
error = false;
updatedLibraryId = libraryId;
updatedComicId = comicId;