mirror of
https://github.com/C9Glax/tranga.git
synced 2025-04-12 19:36:08 +02:00
17 lines
745 B
C#
17 lines
745 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace API.Schema.Jobs;
|
|
|
|
public class DownloadAvailableChaptersJob(ulong recurrenceMs, string mangaId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
|
: Job(TokenGen.CreateToken(typeof(DownloadAvailableChaptersJob)), JobType.DownloadAvailableChaptersJob, recurrenceMs, parentJobId, dependsOnJobsIds)
|
|
{
|
|
[StringLength(64)]
|
|
[Required]
|
|
public string MangaId { get; init; } = mangaId;
|
|
|
|
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
|
{
|
|
return context.Chapters.Where(c => c.ParentMangaId == MangaId).AsEnumerable()
|
|
.Select(chapter => new DownloadSingleChapterJob(chapter.ChapterId, this.JobId));
|
|
}
|
|
} |