mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-22 23:30:13 +01:00
Job Run pass context to add new Data
This commit is contained in:
parent
16dd1ffa97
commit
80190e1286
@ -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<Job> RunInternal()
|
||||
protected override IEnumerable<Job> 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));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user