diff --git a/API/Schema/Contexts/PgsqlContext.cs b/API/Schema/Contexts/PgsqlContext.cs index 2b138e2..7308472 100644 --- a/API/Schema/Contexts/PgsqlContext.cs +++ b/API/Schema/Contexts/PgsqlContext.cs @@ -136,7 +136,7 @@ public class PgsqlContext(DbContextOptions options) : DbContext(op .AutoInclude(); modelBuilder.Entity() .Navigation(m => m.Chapters) - .AutoInclude(); + .AutoInclude(false); //Manga owns MangaAltTitles modelBuilder.Entity() .OwnsMany(m => m.AltTitles) diff --git a/API/Schema/Jobs/MoveMangaLibraryJob.cs b/API/Schema/Jobs/MoveMangaLibraryJob.cs index a533e9c..76dcafa 100644 --- a/API/Schema/Jobs/MoveMangaLibraryJob.cs +++ b/API/Schema/Jobs/MoveMangaLibraryJob.cs @@ -34,6 +34,7 @@ public class MoveMangaLibraryJob : Job protected override IEnumerable RunInternal(PgsqlContext context) { context.Attach(Manga); + context.Entry(Manga).Collection(m => m.Chapters).Load(); Dictionary oldPath = Manga.Chapters.ToDictionary(c => c, c => c.FullArchiveFilePath); Manga.Library = ToLibrary; try diff --git a/API/Schema/Jobs/UpdateFilesDownloadedJob.cs b/API/Schema/Jobs/UpdateFilesDownloadedJob.cs index b0497ee..962b0d2 100644 --- a/API/Schema/Jobs/UpdateFilesDownloadedJob.cs +++ b/API/Schema/Jobs/UpdateFilesDownloadedJob.cs @@ -29,6 +29,7 @@ public class UpdateFilesDownloadedJob : Job protected override IEnumerable RunInternal(PgsqlContext context) { context.Attach(Manga); + context.Entry(Manga).Collection(m => m.Chapters).Load(); foreach (Chapter chapter in Manga.Chapters) chapter.Downloaded = chapter.CheckDownloaded();