From be2adff57dea2171d5aee402885687b1c73f979a Mon Sep 17 00:00:00 2001 From: Glax Date: Fri, 16 May 2025 20:01:50 +0200 Subject: [PATCH] DownloadSingleChapterJob.cs load Jobs --- API/Schema/Jobs/DownloadSingleChapterJob.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/API/Schema/Jobs/DownloadSingleChapterJob.cs b/API/Schema/Jobs/DownloadSingleChapterJob.cs index e7a4d1d..f336ac2 100644 --- a/API/Schema/Jobs/DownloadSingleChapterJob.cs +++ b/API/Schema/Jobs/DownloadSingleChapterJob.cs @@ -3,6 +3,7 @@ using System.IO.Compression; using System.Runtime.InteropServices; using API.MangaDownloadClients; using API.Schema.Contexts; +using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Formats.Jpeg; @@ -37,6 +38,7 @@ public class DownloadSingleChapterJob : Job protected override IEnumerable RunInternal(PgsqlContext context) { context.Attach(Chapter); + context.Attach(Chapter.ParentManga); string[] imageUrls = Chapter.ParentManga.MangaConnector.GetChapterImageUrls(Chapter); if (imageUrls.Length < 1) { @@ -97,6 +99,7 @@ public class DownloadSingleChapterJob : Job Chapter.Downloaded = true; context.SaveChanges(); + context.Jobs.Load(); if (context.Jobs.AsEnumerable().Any(j => { if (j.JobType != JobType.UpdateFilesDownloadedJob)