mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-01-31 00:47:30 +01:00
23 lines
647 B
C#
23 lines
647 B
C#
using Logging;
|
|
|
|
namespace Tranga.TrangaTasks;
|
|
|
|
public class UpdateKomgaLibraryTask : TrangaTask
|
|
{
|
|
public UpdateKomgaLibraryTask(Task task, TimeSpan reoccurrence) : base(task, null, null, reoccurrence)
|
|
{
|
|
}
|
|
|
|
public override void Execute(TaskManager taskManager, Logger? logger)
|
|
{
|
|
StartExecutionChores(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);
|
|
EndExecutionChores(logger);
|
|
}
|
|
} |