Fix Manga-Chapter loading

This commit is contained in:
Glax 2025-05-16 21:09:32 +02:00
parent 3a3306240f
commit d6e945741a
3 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ public class DownloadAvailableChaptersJob : Job
protected override IEnumerable<Job> RunInternal(PgsqlContext context) protected override IEnumerable<Job> RunInternal(PgsqlContext context)
{ {
context.Attach(Manga); context.Attach(Manga);
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
return Manga.Chapters.Select(chapter => new DownloadSingleChapterJob(chapter, this)); return Manga.Chapters.Select(chapter => new DownloadSingleChapterJob(chapter, this));
} }
} }

View File

@ -37,6 +37,7 @@ public class UpdateChaptersDownloadedJob : Job
protected override IEnumerable<Job> RunInternal(PgsqlContext context) protected override IEnumerable<Job> RunInternal(PgsqlContext context)
{ {
context.Attach(Manga); context.Attach(Manga);
context.Entry(Manga).Collection<Chapter>(m => m.Chapters).Load();
return Manga.Chapters.Select(c => new UpdateSingleChapterDownloadedJob(c, this)); return Manga.Chapters.Select(c => new UpdateSingleChapterDownloadedJob(c, this));
} }
} }

View File

@ -39,7 +39,6 @@ public class UpdateSingleChapterDownloadedJob : Job
{ {
context.Attach(Chapter); context.Attach(Chapter);
Chapter.Downloaded = Chapter.CheckDownloaded(); Chapter.Downloaded = Chapter.CheckDownloaded();
context.SaveChanges();
try try
{ {