mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-11 13:19:48 +02:00
Add RefreshLibrariesWorker.cs
This commit is contained in:
@@ -18,10 +18,7 @@ public class StartNewChapterDownloadsWorker(TimeSpan? interval = null, IEnumerab
|
||||
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);
|
||||
List<MangaConnectorId<Chapter>> missingChapters = await GetMissingChapters(DbContext, CancellationToken);
|
||||
|
||||
Log.Debug($"Found {missingChapters.Count} missing downloads.");
|
||||
|
||||
@@ -37,4 +34,9 @@ public class StartNewChapterDownloadsWorker(TimeSpan? interval = null, IEnumerab
|
||||
|
||||
return newWorkers.ToArray();
|
||||
}
|
||||
|
||||
internal static async Task<List<MangaConnectorId<Chapter>>> GetMissingChapters(MangaContext ctx, CancellationToken cancellationToken) => await ctx.MangaConnectorToChapter
|
||||
.Include(id => id.Obj)
|
||||
.Where(id => id.Obj.Downloaded == false && id.UseForDownload)
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
Reference in New Issue
Block a user