mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 20:08:19 +02:00
Context Load Navigations and Collections
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using API.Schema.MangaContext;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace API.Workers;
|
||||
|
||||
public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerable<BaseWorker>? dependsOn = null)
|
||||
@@ -8,7 +10,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab
|
||||
public TimeSpan Interval { get; set; } = interval??TimeSpan.FromMinutes(60);
|
||||
protected override BaseWorker[] DoWorkInternal()
|
||||
{
|
||||
foreach (Chapter dbContextChapter in DbContext.Chapters)
|
||||
foreach (Chapter dbContextChapter in DbContext.Chapters.Include(c => c.ParentManga))
|
||||
dbContextChapter.Downloaded = dbContextChapter.CheckDownloaded();
|
||||
|
||||
DbContext.Sync();
|
||||
|
Reference in New Issue
Block a user