From 28fa85f05c1cad2918dd6d5700521f37ba965d62 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 13 Sep 2023 14:20:10 +0200 Subject: [PATCH] #50 Added parameter translatedLanguage POST Jobs/DownloadNewChapters POST Jobs/MonitorManga --- Tranga/Server.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tranga/Server.cs b/Tranga/Server.cs index 93ee3a9..3e943f7 100644 --- a/Tranga/Server.cs +++ b/Tranga/Server.cs @@ -226,7 +226,7 @@ public class Server : GlobalBase private void HandlePost(HttpListenerRequest request, HttpListenerResponse response) { Dictionary requestVariables = GetRequestVariables(request.Url!.Query); - string? connectorName, internalId, jobId, chapterNumStr, customFolderName; + string? connectorName, internalId, jobId, chapterNumStr, customFolderName, translatedLanguage; MangaConnector? connector; Manga? tmpManga; Manga manga; @@ -270,8 +270,9 @@ public class Server : GlobalBase if (requestVariables.TryGetValue("customFolderName", out 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); break; case "Jobs/DownloadNewChapters": @@ -298,8 +299,9 @@ public class Server : GlobalBase if (requestVariables.TryGetValue("customFolderName", out 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); break; case "Jobs/StartNow":