mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
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:
@ -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;
|
||||
|
@ -170,6 +170,12 @@ QJsonObject YACReaderServerDataHelper::fullComicToJSON(const qulonglong libraryI
|
||||
json["brightness"] = comic.info.brightness;
|
||||
json["contrast"] = comic.info.contrast;
|
||||
json["gamma"] = comic.info.gamma;
|
||||
// 9.16
|
||||
variantToJson("image_filters_json", QMetaType::QString, comic.info.imageFiltersJson, json);
|
||||
variantToJson("last_time_image_filters_set", QMetaType::LongLong, comic.info.lastTimeImageFiltersSet, json);
|
||||
variantToJson("last_time_cover_set", QMetaType::LongLong, comic.info.lastTimeCoverSet, json);
|
||||
variantToJson("uses_external_cover", QMetaType::Bool, comic.info.usesExternalCover, json);
|
||||
variantToJson("last_time_metadata_set", QMetaType::LongLong, comic.info.lastTimeMetadataSet, json);
|
||||
|
||||
return json;
|
||||
}
|
||||
|
Reference in New Issue
Block a user