API: Edit Settings

This commit is contained in:
glax 2023-05-21 16:49:55 +02:00
parent e2afc09c4a
commit 6f1a6a43ee
2 changed files with 5 additions and 3 deletions

View File

@ -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();

View File

@ -17,7 +17,6 @@ public class TaskManager
private readonly Dictionary<Connector, List<TrangaTask>> _taskQueue = new();
public SettingsData settings { get; }
private Logger? logger { get; }
public Komga? komga { get; }
/// <param name="downloadFolderPath">Local path to save data (Manga) to</param>