From 80190e1286946c8b16f5ea59d10e852d91819f90 Mon Sep 17 00:00:00 2001 From: Glax Date: Tue, 17 Dec 2024 17:24:25 +0100 Subject: [PATCH] Job Run pass context to add new Data --- API/Schema/Jobs/DownloadNewChaptersJob.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/API/Schema/Jobs/DownloadNewChaptersJob.cs b/API/Schema/Jobs/DownloadNewChaptersJob.cs index 0f2ca81..2690e46 100644 --- a/API/Schema/Jobs/DownloadNewChaptersJob.cs +++ b/API/Schema/Jobs/DownloadNewChaptersJob.cs @@ -12,10 +12,11 @@ public class DownloadNewChaptersJob(ulong recurrenceMs, string mangaId, string? public string MangaId { get; init; } = mangaId; public virtual Manga Manga { get; init; } - protected override IEnumerable RunInternal() + protected override IEnumerable RunInternal(PgsqlContext context) { MangaConnector connector = Manga.MangaConnector; Chapter[] newChapters = connector.GetNewChapters(Manga); + context.Chapters.AddRangeAsync(newChapters).Wait(); return newChapters.Select(chapter => new DownloadSingleChapterJob(chapter.ChapterId, this.JobId)); } } \ No newline at end of file