Tranga-Website/Tranga/TrangaTasks/UpdateKomgaLibraryTask.cs

21 lines
580 B
C#
Raw Normal View History

2023-05-31 22:32:37 +02:00
using Logging;
namespace Tranga.TrangaTasks;
public class UpdateKomgaLibraryTask : TrangaTask
{
public UpdateKomgaLibraryTask(Task task, TimeSpan reoccurrence) : base(task, null, null, reoccurrence)
{
}
protected override void ExecuteTask(TaskManager taskManager, Logger? logger)
{
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);
}
}