mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
19 lines
702 B
C#
19 lines
702 B
C#
using API.Schema.MangaContext;
|
|
|
|
namespace API.Workers;
|
|
|
|
public class UpdateCoversWorker(TimeSpan? interval = null, IEnumerable<BaseWorker>? dependsOn = null)
|
|
: BaseWorkerWithContext<MangaContext>(dependsOn), IPeriodic
|
|
{
|
|
|
|
public DateTime LastExecution { get; set; } = DateTime.UnixEpoch;
|
|
public TimeSpan Interval { get; set; } = interval ?? TimeSpan.FromHours(6);
|
|
|
|
protected override BaseWorker[] DoWorkInternal()
|
|
{
|
|
List<BaseWorker> workers = new();
|
|
foreach (MangaConnectorId<Manga> mangaConnectorId in DbContext.MangaConnectorToManga)
|
|
workers.Add(new DownloadCoverFromMangaconnectorWorker(mangaConnectorId));
|
|
return workers.ToArray();
|
|
}
|
|
} |