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