Fix new Workers not getting added.

This commit is contained in:
2025-09-04 23:02:24 +02:00
parent c8be88d645
commit 2d662c269b
2 changed files with 10 additions and 0 deletions

View File

@@ -14,12 +14,16 @@ public class StartNewChapterDownloadsWorker(TimeSpan? interval = null, IEnumerab
public TimeSpan Interval { get; set; } = interval ?? TimeSpan.FromMinutes(1);
protected override async Task<BaseWorker[]> DoWorkInternal()
{
Log.Debug("Checking for missing chapters...");
// Get missing chapters
List<MangaConnectorId<Chapter>> missingChapters = await DbContext.MangaConnectorToChapter
.Include(id => id.Obj)
.Where(id => id.Obj.Downloaded == false && id.UseForDownload)
.ToListAsync(CancellationToken);
Log.Debug($"Found {missingChapters.Count} missing downloads.");
// Create new jobs
List<BaseWorker> newWorkers = missingChapters.Select(mcId => new DownloadChapterFromMangaconnectorWorker(mcId)).ToList<BaseWorker>();