Fix comic to json conversion.

This commit is contained in:
Luis Ángel San Martín 2018-03-11 15:26:28 +01:00
parent 69395398e1
commit d7d741f87e

View File

@ -23,14 +23,14 @@ QString YACReaderServerDataHelper::comicToYSFormat(const qulonglong libraryId,co
.arg(comic.info.read?1:0); .arg(comic.info.read?1:0);
} }
static QJsonObject YACReaderServerDataHelper::comicToJSON(const qulonglong libraryId, const ComicDB & comic) QJsonObject YACReaderServerDataHelper::comicToJSON(const qulonglong libraryId, const ComicDB & comic)
{ {
QJsonObject json; QJsonObject json;
json["type"] = "comic"; json["type"] = "comic";
json["id"] = comic.id; json["id"] = QString::number(comic.id);
json["file_name"] = comic.getFileName(); json["file_name"] = comic.getFileName();
json["file_size"] = comic.getFileSize(); json["file_size"] = QString::number(comic.getFileSize());
json["hash"] = comic.info.hash; json["hash"] = comic.info.hash;
json["current_page"] = comic.info.currentPage; json["current_page"] = comic.info.currentPage;
json["num_pages"] = comic.info.numPages.toInt(); json["num_pages"] = comic.info.numPages.toInt();