API: Kavita Auth #33
This commit is contained in:
parent
4f29eff48e
commit
783fd8129e
@ -212,7 +212,7 @@ app.MapDelete("/Queue/Dequeue", (string taskType, string? connectorName, string?
|
|||||||
app.MapGet("/Settings/Get", () => taskManager.settings);
|
app.MapGet("/Settings/Get", () => taskManager.settings);
|
||||||
|
|
||||||
app.MapPost("/Settings/Update",
|
app.MapPost("/Settings/Update",
|
||||||
(string? downloadLocation, string? komgaUrl, string? komgaAuth, string? kavitaUrl, string? kavitaAuth) =>
|
(string? downloadLocation, string? komgaUrl, string? komgaAuth, string? kavitaUrl, string? kavitaApiKey) =>
|
||||||
taskManager.UpdateSettings(downloadLocation, komgaUrl, komgaAuth, kavitaUrl, kavitaAuth));
|
taskManager.UpdateSettings(downloadLocation, komgaUrl, komgaAuth, kavitaUrl, kavitaApiKey));
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
@ -47,17 +47,17 @@ public class TaskManager
|
|||||||
taskChecker.Start();
|
taskChecker.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSettings(string? downloadLocation, string? komgaUrl, string? komgaAuth, string? kavitaUrl, string? kavitaAuth)
|
public void UpdateSettings(string? downloadLocation, string? komgaUrl, string? komgaAuth, string? kavitaUrl, string? kavitaApiKey)
|
||||||
{
|
{
|
||||||
if (komgaUrl is not null && komgaAuth is not null && komgaUrl.Length > 0 && komgaAuth.Length > 0)
|
if (komgaUrl is not null && komgaAuth is not null && komgaUrl.Length > 0 && komgaAuth.Length > 0)
|
||||||
{
|
{
|
||||||
settings.libraryManagers.RemoveWhere(lm => lm.GetType() == typeof(Komga));
|
settings.libraryManagers.RemoveWhere(lm => lm.GetType() == typeof(Komga));
|
||||||
settings.libraryManagers.Add(new Komga(komgaUrl, komgaAuth, logger));
|
settings.libraryManagers.Add(new Komga(komgaUrl, komgaAuth, logger));
|
||||||
}
|
}
|
||||||
if (kavitaUrl is not null && kavitaAuth is not null && kavitaUrl.Length > 0 && kavitaAuth.Length > 0)
|
if (kavitaUrl is not null && kavitaApiKey is not null && kavitaUrl.Length > 0 && kavitaApiKey.Length > 0)
|
||||||
{
|
{
|
||||||
settings.libraryManagers.RemoveWhere(lm => lm.GetType() == typeof(Kavita));
|
settings.libraryManagers.RemoveWhere(lm => lm.GetType() == typeof(Kavita));
|
||||||
settings.libraryManagers.Add(new Kavita(kavitaUrl, kavitaAuth, logger));
|
settings.libraryManagers.Add(new Kavita(kavitaUrl, kavitaApiKey, logger));
|
||||||
}
|
}
|
||||||
if (downloadLocation is not null && downloadLocation.Length > 0)
|
if (downloadLocation is not null && downloadLocation.Length > 0)
|
||||||
settings.downloadLocation = downloadLocation;
|
settings.downloadLocation = downloadLocation;
|
||||||
|
Loading…
Reference in New Issue
Block a user