From adc7ee606e354fa0a38397c752aa8e6871cad6ac Mon Sep 17 00:00:00 2001 From: Glax Date: Fri, 16 May 2025 20:00:53 +0200 Subject: [PATCH] RetrieveChaptersJob.cs do not use context to access Chapters --- API/Schema/Jobs/RetrieveChaptersJob.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/API/Schema/Jobs/RetrieveChaptersJob.cs b/API/Schema/Jobs/RetrieveChaptersJob.cs index a89f7c6..d304af8 100644 --- a/API/Schema/Jobs/RetrieveChaptersJob.cs +++ b/API/Schema/Jobs/RetrieveChaptersJob.cs @@ -32,9 +32,10 @@ public class RetrieveChaptersJob : Job protected override IEnumerable RunInternal(PgsqlContext context) { context.Attach(Manga); + context.Entry(Manga).Collection(m => m.Chapters).Load(); // This gets all chapters that are not downloaded Chapter[] allChapters = Manga.MangaConnector.GetChapters(Manga, Language); - Chapter[] newChapters = allChapters.Where(chapter => context.Chapters.Contains(chapter) == false).ToArray(); + Chapter[] newChapters = allChapters.Where(chapter => Manga.Chapters.Contains(chapter) == false).ToArray(); Log.Info($"{newChapters.Length} new chapters."); try