mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 11:04:25 -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 ReadingListContentControllerV2::service(HttpRequest &request, HttpResponse
|
||||
|
||||
void ReadingListContentControllerV2::serviceContent(const int &library, const qulonglong &readingListId, HttpResponse &response)
|
||||
{
|
||||
auto libraryUuid = DBHelper::getLibraries().getLibraryIdFromLegacyId(library);
|
||||
|
||||
QList<ComicDB> comics = DBHelper::getReadingListFullContent(library, readingListId);
|
||||
|
||||
QJsonArray items;
|
||||
|
||||
for (const ComicDB &comic : comics) {
|
||||
items.append(YACReaderServerDataHelper::comicToJSON(library, comic));
|
||||
items.append(YACReaderServerDataHelper::comicToJSON(library, libraryUuid, comic));
|
||||
}
|
||||
|
||||
QJsonDocument output(items);
|
||||
|
Reference in New Issue
Block a user