2
0

#50 Added parameter translatedLanguage POST Jobs/DownloadNewChapters

POST Jobs/MonitorManga
This commit is contained in:
glax 2023-09-13 14:20:10 +02:00
parent 1066e1ca2e
commit 28fa85f05c

View File

@ -226,7 +226,7 @@ public class Server : GlobalBase
private void HandlePost(HttpListenerRequest request, HttpListenerResponse response) private void HandlePost(HttpListenerRequest request, HttpListenerResponse response)
{ {
Dictionary<string, string> requestVariables = GetRequestVariables(request.Url!.Query); Dictionary<string, string> requestVariables = GetRequestVariables(request.Url!.Query);
string? connectorName, internalId, jobId, chapterNumStr, customFolderName; string? connectorName, internalId, jobId, chapterNumStr, customFolderName, translatedLanguage;
MangaConnector? connector; MangaConnector? connector;
Manga? tmpManga; Manga? tmpManga;
Manga manga; Manga manga;
@ -270,8 +270,9 @@ public class Server : GlobalBase
if (requestVariables.TryGetValue("customFolderName", out customFolderName)) if (requestVariables.TryGetValue("customFolderName", out customFolderName))
manga.MovePublicationFolder(settings.downloadLocation, customFolderName); manga.MovePublicationFolder(settings.downloadLocation, customFolderName);
requestVariables.TryGetValue("translatedLanguage", out translatedLanguage);
_parent.jobBoss.AddJob(new DownloadNewChapters(this, connector!, manga, true, interval)); _parent.jobBoss.AddJob(new DownloadNewChapters(this, connector!, manga, true, interval, translatedLanguage: translatedLanguage??"en"));
SendResponse(HttpStatusCode.Accepted, response); SendResponse(HttpStatusCode.Accepted, response);
break; break;
case "Jobs/DownloadNewChapters": case "Jobs/DownloadNewChapters":
@ -298,8 +299,9 @@ public class Server : GlobalBase
if (requestVariables.TryGetValue("customFolderName", out customFolderName)) if (requestVariables.TryGetValue("customFolderName", out customFolderName))
manga.MovePublicationFolder(settings.downloadLocation, customFolderName); manga.MovePublicationFolder(settings.downloadLocation, customFolderName);
requestVariables.TryGetValue("translatedLanguage", out translatedLanguage);
_parent.jobBoss.AddJob(new DownloadNewChapters(this, connector!, manga, false)); _parent.jobBoss.AddJob(new DownloadNewChapters(this, connector!, manga, false, translatedLanguage: translatedLanguage??"en"));
SendResponse(HttpStatusCode.Accepted, response); SendResponse(HttpStatusCode.Accepted, response);
break; break;
case "Jobs/StartNow": case "Jobs/StartNow":