mirror of
https://github.com/YACReader/yacreader
synced 2025-07-17 20:44:32 -04:00
Add more info to json content + better handling of optionality
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "db_helper.h"
|
||||
#include "comic_db.h"
|
||||
|
||||
#include "yacreader_libraries.h"
|
||||
#include "yacreader_server_data_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
@ -28,12 +29,14 @@ void ReadingComicsControllerV2::service(HttpRequest &request, HttpResponse &resp
|
||||
|
||||
void ReadingComicsControllerV2::serviceContent(const int &library, HttpResponse &response)
|
||||
{
|
||||
auto libraryUuid = DBHelper::getLibraries().getLibraryIdFromLegacyId(library);
|
||||
|
||||
QList<ComicDB> readingComics = DBHelper::getReading(library);
|
||||
|
||||
QJsonArray comics;
|
||||
|
||||
for (const ComicDB &comic : readingComics) {
|
||||
comics.append(YACReaderServerDataHelper::comicToJSON(library, comic));
|
||||
comics.append(YACReaderServerDataHelper::comicToJSON(library, libraryUuid, comic));
|
||||
}
|
||||
|
||||
QJsonDocument output(comics);
|
||||
|
Reference in New Issue
Block a user