Map the new controller to its path

This commit is contained in:
Luis Ángel San Martín 2021-05-25 21:46:35 +02:00
parent 0333c9f050
commit 50840e955d

View File

@ -39,6 +39,7 @@
#include "controllers/v2/readinglistcontentcontroller_v2.h" #include "controllers/v2/readinglistcontentcontroller_v2.h"
#include "controllers/v2/readinglistinfocontroller_v2.h" #include "controllers/v2/readinglistinfocontroller_v2.h"
#include "controllers/v2/comicfullinfocontroller_v2.h" #include "controllers/v2/comicfullinfocontroller_v2.h"
#include "controllers/v2/comiccontrollerinreadinglist_v2.h"
#include "db_helper.h" #include "db_helper.h"
#include "yacreader_libraries.h" #include "yacreader_libraries.h"
@ -234,6 +235,7 @@ void RequestMapper::serviceV2(HttpRequest &request, HttpResponse &response)
QRegExp comicDownloadInfo("/v2/library/.+/comic/[0-9]+/info/?"); //get comic info (full download info) QRegExp comicDownloadInfo("/v2/library/.+/comic/[0-9]+/info/?"); //get comic info (full download info)
QRegExp comicOpenForDownloading("/v2/library/.+/comic/[0-9]+/?"); //get comic info (full info + opening) QRegExp comicOpenForDownloading("/v2/library/.+/comic/[0-9]+/?"); //get comic info (full info + opening)
QRegExp comicOpenForRemoteReading("/v2/library/.+/comic/[0-9]+/remote/?"); //the server will open for reading the comic QRegExp comicOpenForRemoteReading("/v2/library/.+/comic/[0-9]+/remote/?"); //the server will open for reading the comic
QRegExp comicOpenForRemoteReadingInAReadingList("/v2/library/.+/reading_list/[0-9]+/comic/[0-9]+/remote/?"); //the server will open for reading the comic
QRegExp comicFullInfo("/v2/library/.+/comic/[0-9]+/fullinfo/?"); //get comic info QRegExp comicFullInfo("/v2/library/.+/comic/[0-9]+/fullinfo/?"); //get comic info
QRegExp comicUpdate("/v2/library/.+/comic/[0-9]+/update/?"); //get comic info QRegExp comicUpdate("/v2/library/.+/comic/[0-9]+/update/?"); //get comic info
QRegExp comicClose("/v2/library/.+/comic/[0-9]+/close/?"); //the server will close the comic and free memory QRegExp comicClose("/v2/library/.+/comic/[0-9]+/close/?"); //the server will close the comic and free memory
@ -277,8 +279,9 @@ void RequestMapper::serviceV2(HttpRequest &request, HttpResponse &response)
CoverControllerV2().service(request, response); CoverControllerV2().service(request, response);
} else if (comicDownloadInfo.exactMatch(path)) { } else if (comicDownloadInfo.exactMatch(path)) {
ComicDownloadInfoControllerV2().service(request, response); ComicDownloadInfoControllerV2().service(request, response);
} else if (comicOpenForDownloading.exactMatch(path) || comicOpenForRemoteReading.exactMatch(path)) //start download or start remote reading } else if (comicOpenForRemoteReadingInAReadingList.exactMatch(path)) {
{ ComicControllerInReadingListV2().service(request, response);
} else if (comicOpenForDownloading.exactMatch(path) || comicOpenForRemoteReading.exactMatch(path)) { //start download or start remote reading
ComicControllerV2().service(request, response); ComicControllerV2().service(request, response);
} else if (comicFullInfo.exactMatch(path)) { } else if (comicFullInfo.exactMatch(path)) {
ComicFullinfoController_v2().service(request, response); ComicFullinfoController_v2().service(request, response);