From 003d88aa24ad449eff8493d0f255bae718370304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 10 Jun 2023 10:59:28 +0200 Subject: [PATCH] Calculate manga from type when serving json from the SearchController --- .../server/controllers/v2/searchcontroller_v2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/YACReaderLibrary/server/controllers/v2/searchcontroller_v2.cpp b/YACReaderLibrary/server/controllers/v2/searchcontroller_v2.cpp index 8748eabe..3c321cd6 100644 --- a/YACReaderLibrary/server/controllers/v2/searchcontroller_v2.cpp +++ b/YACReaderLibrary/server/controllers/v2/searchcontroller_v2.cpp @@ -96,7 +96,9 @@ void SearchController::getComics(int libraryId, QSqlQuery &sqlQuery, QJsonArray json["title"] = sqlQuery.value("title").toString(); json["number"] = sqlQuery.value("number").toInt(); json["last_time_opened"] = sqlQuery.value("lastTimeOpened").toLongLong(); - json["manga"] = sqlQuery.value("manga").toBool(); + auto typeVariant = sqlQuery.value("type"); + auto type = typeVariant.value(); + json["manga"] = type == YACReader::FileType::Manga; // legacy, kept for compatibility with old clients items.append(json); }