2023-06-03 15:17:08 +02:00
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
namespace Tranga.TrangaTasks;
|
|
|
|
|
|
|
|
|
|
public class UpdateLibrariesTask : TrangaTask
|
|
|
|
|
{
|
2023-06-05 00:35:57 +02:00
|
|
|
|
public UpdateLibrariesTask(Task task, TimeSpan reoccurrence) : base(task, reoccurrence)
|
2023-06-03 15:17:08 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-10 14:27:09 +02:00
|
|
|
|
protected override void ExecuteTask(TaskManager taskManager, Logger? logger, CancellationToken? cancellationToken = null)
|
2023-06-03 15:17:08 +02:00
|
|
|
|
{
|
2023-06-10 14:27:09 +02:00
|
|
|
|
if (cancellationToken?.IsCancellationRequested??false)
|
|
|
|
|
return;
|
2023-06-03 15:17:08 +02:00
|
|
|
|
foreach(LibraryManager lm in taskManager.settings.libraryManagers)
|
|
|
|
|
lm.UpdateLibrary();
|
2023-06-05 00:35:57 +02:00
|
|
|
|
this.progress = 1f;
|
2023-06-03 15:17:08 +02:00
|
|
|
|
}
|
|
|
|
|
}
|