mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-21 21:53:01 +02:00
DownloadSingleChapterJob only spawn one Job per Queue for Manga
This commit is contained in:
parent
d08544b892
commit
a5954ed5c8
@ -97,7 +97,16 @@ public class DownloadSingleChapterJob : Job
|
||||
Chapter.Downloaded = true;
|
||||
context.SaveChanges();
|
||||
|
||||
return [new UpdateFilesDownloadedJob(Chapter.ParentManga, 0, this)];
|
||||
if (context.Jobs.AsEnumerable().Any(j =>
|
||||
{
|
||||
if (j.JobType != JobType.UpdateFilesDownloadedJob)
|
||||
return false;
|
||||
UpdateFilesDownloadedJob job = (UpdateFilesDownloadedJob)j;
|
||||
return job.MangaId == this.Chapter.ParentMangaId;
|
||||
}))
|
||||
return [];
|
||||
|
||||
return [new UpdateFilesDownloadedJob(Chapter.ParentManga, 0, this.ParentJob)];
|
||||
}
|
||||
|
||||
private void ProcessImage(string imagePath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user