From c3a0bb03e9a8f3e777485415cd0384815a3e0075 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 3 Jul 2025 20:53:20 +0200 Subject: [PATCH] SettingsController set download language --- API/Controllers/SettingsController.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/API/Controllers/SettingsController.cs b/API/Controllers/SettingsController.cs index 6da2177..b4deaeb 100644 --- a/API/Controllers/SettingsController.cs +++ b/API/Controllers/SettingsController.cs @@ -272,4 +272,28 @@ public class SettingsController(IServiceScope scope) : Controller RequestResult result = client.MakeRequestInternal(knownProtectedUrl); return (int)result.statusCode >= 200 && (int)result.statusCode < 300 ? Ok() : StatusCode(500, result.statusCode); } + + /// + /// Returns the language in which Manga are downloaded + /// + /// + [HttpGet("DownloadLanguage")] + [ProducesResponseType(Status200OK, "text/plain")] + public IActionResult GetDownloadLanguage() + { + return Ok(Tranga.Settings.DownloadLanguage); + } + + /// + /// Sets the language in which Manga are downloaded + /// + /// + [HttpPatch("DownloadLanguage/{Language}")] + [ProducesResponseType(Status200OK)] + public IActionResult SetDownloadLanguage(string Language) + { + //TODO Validation + Tranga.Settings.SetDownloadLanguage(Language); + return Ok(); + } } \ No newline at end of file