mirror of
https://github.com/YACReader/yacreader
synced 2025-07-17 20:44:32 -04:00
Use json in foldercontentcontoller_v2
This commit is contained in:
@ -23,12 +23,27 @@ QString YACReaderServerDataHelper::comicToYSFormat(const qulonglong libraryId,co
|
||||
.arg(comic.info.read?1:0);
|
||||
}
|
||||
|
||||
QJsonObject YACReaderServerDataHelper::folderToJSON(const qulonglong libraryId, const Folder & folder)
|
||||
{
|
||||
QJsonObject json;
|
||||
|
||||
json["type"] = "folder";
|
||||
json["id"] = QString::number(folder.id);
|
||||
json["library_id"] = QString::number(libraryId);
|
||||
json["folder_name"] = folder.name;
|
||||
json["num_children"] = QString::number(folder.getNumChildren());
|
||||
json["first_comic_hash"] = folder.getFirstChildHash();
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
QJsonObject YACReaderServerDataHelper::comicToJSON(const qulonglong libraryId, const ComicDB & comic)
|
||||
{
|
||||
QJsonObject json;
|
||||
|
||||
json["type"] = "comic";
|
||||
json["id"] = QString::number(comic.id);
|
||||
json["library_id"] = QString::number(libraryId);
|
||||
json["file_name"] = comic.name;
|
||||
json["file_size"] = QString::number(comic.getFileSize());
|
||||
json["hash"] = comic.info.hash;
|
||||
|
Reference in New Issue
Block a user