mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Return 404 if the comic is not found
This commit is contained in:
@ -26,9 +26,6 @@ void ComicFullinfoController_v2::service(HttpRequest &request, HttpResponse &res
|
||||
qulonglong comicId = pathElements.at(5).toULongLong();
|
||||
|
||||
serviceContent(libraryId, comicId, response);
|
||||
|
||||
response.setStatus(200, "OK");
|
||||
response.write("", true);
|
||||
}
|
||||
|
||||
void ComicFullinfoController_v2::serviceContent(const int &libraryId, const qulonglong &comicId, HttpResponse &response)
|
||||
@ -37,9 +34,18 @@ void ComicFullinfoController_v2::serviceContent(const int &libraryId, const qulo
|
||||
|
||||
ComicDB comic = DBHelper::getComicInfo(libraryId, comicId);
|
||||
|
||||
if (!comic.info.existOnDb) {
|
||||
response.setStatus(404, "Not Found");
|
||||
response.write("", true);
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonObject json = YACReaderServerDataHelper::fullComicToJSON(libraryId, libraryUuid, comic);
|
||||
|
||||
QJsonDocument output(json);
|
||||
|
||||
response.write(output.toJson(QJsonDocument::Compact));
|
||||
|
||||
response.setStatus(200, "OK");
|
||||
response.write("", true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user