API: Edit Settings
This commit is contained in:
parent
e2afc09c4a
commit
6f1a6a43ee
@ -146,9 +146,12 @@ app.MapGet("/TaskDequeue", (TrangaTask.Task task, string? connectorName, string?
|
|||||||
return JsonSerializer.Serialize("Success");
|
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();
|
app.Run();
|
||||||
|
@ -17,7 +17,6 @@ public class TaskManager
|
|||||||
private readonly Dictionary<Connector, List<TrangaTask>> _taskQueue = new();
|
private readonly Dictionary<Connector, List<TrangaTask>> _taskQueue = new();
|
||||||
public SettingsData settings { get; }
|
public SettingsData settings { get; }
|
||||||
private Logger? logger { get; }
|
private Logger? logger { get; }
|
||||||
|
|
||||||
public Komga? komga { get; }
|
public Komga? komga { get; }
|
||||||
|
|
||||||
/// <param name="downloadFolderPath">Local path to save data (Manga) to</param>
|
/// <param name="downloadFolderPath">Local path to save data (Manga) to</param>
|
||||||
|
Loading…
Reference in New Issue
Block a user