Compare commits

..

No commits in common. "e2afc09c4a81035530ae9fab8987c2354951cd87" and "755167c39ae8fb09758c876946e459b3ea2eca38" have entirely different histories.

View File

@ -135,8 +135,7 @@ app.MapGet("/TaskEnqueue", (TrangaTask.Task task, string? connectorName, string?
}); });
app.MapGet("/TaskDequeue", (TrangaTask.Task task, string? connectorName, string? publicationInternalId) => app.MapGet("/TaskDequeue", (TrangaTask.Task task, string? connectorName, string? publicationInternalId) =>
{ {TrangaTask[] allTasks = taskManager.GetAllTasks();
TrangaTask[] allTasks = taskManager.GetAllTasks();
TrangaTask? taskToDequeue = allTasks.FirstOrDefault(tTask => TrangaTask? taskToDequeue = allTasks.FirstOrDefault(tTask =>
tTask.task == task && tTask.connectorName == connectorName && tTask.task == task && tTask.connectorName == connectorName &&
tTask.publication?.internalId == publicationInternalId); tTask.publication?.internalId == publicationInternalId);
@ -146,36 +145,4 @@ app.MapGet("/TaskDequeue", (TrangaTask.Task task, string? connectorName, string?
return JsonSerializer.Serialize("Success"); return JsonSerializer.Serialize("Success");
}); });
app.MapGet("/Settings", () => app.Run();
{
return JsonSerializer.Serialize(new Settings(taskManager.settings));
});
app.Run();
struct Settings
{
public Komga? komga { get; set; }
public string downloadLocation { get; set; }
public string settingsFilePath { get; set; }
public Settings(TaskManager.SettingsData data)
{
this.settingsFilePath = data.settingsFilePath;
this.downloadLocation = data.downloadLocation;
this.komga = data.komga;
}
public Settings(string downloadLocation, string settingsFilePath, Komga komga)
{
this.downloadLocation = downloadLocation;
this.settingsFilePath = settingsFilePath;
this.komga = komga;
}
public void Update(string? newDownloadLocation = null, string? newSettingsFilePath = null, Komga? newKomga= null)
{
this.downloadLocation = newDownloadLocation ?? this.downloadLocation;
this.settingsFilePath = newSettingsFilePath ?? this.settingsFilePath;
this.komga = newKomga ?? this.komga;
}
}