2023-05-31 22:32:37 +02:00
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
namespace Tranga.TrangaTasks;
|
2023-05-31 21:15:32 +02:00
|
|
|
|
|
|
|
|
|
public class UpdateKomgaLibraryTask : TrangaTask
|
|
|
|
|
{
|
|
|
|
|
public UpdateKomgaLibraryTask(Task task, TimeSpan reoccurrence) : base(task, null, null, reoccurrence)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-01 10:35:23 +02:00
|
|
|
|
protected override void ExecuteTask(TaskManager taskManager, Logger? logger)
|
2023-05-31 21:15:32 +02:00
|
|
|
|
{
|
|
|
|
|
if (taskManager.komga is null)
|
|
|
|
|
return;
|
|
|
|
|
Komga komga = taskManager.komga;
|
|
|
|
|
|
|
|
|
|
Komga.KomgaLibrary[] allLibraries = komga.GetLibraries();
|
|
|
|
|
foreach (Komga.KomgaLibrary lib in allLibraries)
|
|
|
|
|
komga.UpdateLibrary(lib.id);
|
|
|
|
|
}
|
|
|
|
|
}
|