From 6940e6c64d6f37a6f365b9123e6d6488c16eb23a Mon Sep 17 00:00:00 2001 From: Glax Date: Mon, 16 Dec 2024 23:05:12 +0100 Subject: [PATCH] Include Manga and Chapter in jobs --- API/Schema/PgsqlContext.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/API/Schema/PgsqlContext.cs b/API/Schema/PgsqlContext.cs index ca63169..85bd163 100644 --- a/API/Schema/PgsqlContext.cs +++ b/API/Schema/PgsqlContext.cs @@ -44,12 +44,22 @@ public class PgsqlContext(DbContextOptions options) : DbContext(op .HasValue(NotificationConnectorType.Gotify) .HasValue(NotificationConnectorType.Ntfy) .HasValue(NotificationConnectorType.LunaSea); + modelBuilder.Entity() .HasDiscriminator(j => j.JobType) .HasValue(JobType.MoveFileOrFolderJob) .HasValue(JobType.DownloadNewChaptersJob) .HasValue(JobType.DownloadSingleChapterJob) .HasValue(JobType.UpdateMetaDataJob); + modelBuilder.Entity() + .Navigation(dncj => dncj.Manga) + .AutoInclude(); + modelBuilder.Entity() + .Navigation(dscj => dscj.Chapter) + .AutoInclude(); + modelBuilder.Entity() + .Navigation(umj => umj.Manga) + .AutoInclude(); modelBuilder.Entity() .HasOne(m => m.MangaConnector);