diff --git a/Tranga-API/Program.cs b/Tranga-API/Program.cs index d9da4a5..a044dd2 100644 --- a/Tranga-API/Program.cs +++ b/Tranga-API/Program.cs @@ -146,9 +146,12 @@ app.MapGet("/TaskDequeue", (TrangaTask.Task task, string? connectorName, string? return JsonSerializer.Serialize("Success"); }); -app.MapGet("/Settings", () => +app.MapGet("/Settings", () => JsonSerializer.Serialize(new Settings(taskManager.settings))); + +app.MapGet("/EditSettings", (string downloadLocation, string komgaBaseUrl, string komgaAuthString) => { - return JsonSerializer.Serialize(new Settings(taskManager.settings)); + taskManager.settings.downloadLocation = downloadLocation; + taskManager.settings.komga = new Komga(komgaBaseUrl, komgaAuthString, logger); }); app.Run(); diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index 6b23722..23f577a 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -17,7 +17,6 @@ public class TaskManager private readonly Dictionary> _taskQueue = new(); public SettingsData settings { get; } private Logger? logger { get; } - public Komga? komga { get; } /// Local path to save data (Manga) to