Fixes #97 missing jobs.

Implemented Equals(obj) functions for Chapter, DownloadChapter and DownloadNewChapters to check if jobs already exist.
This commit is contained in:
2024-01-11 20:19:04 +01:00
parent 0c135aa89e
commit b5be4e0dd8
5 changed files with 33 additions and 9 deletions

View File

@ -43,15 +43,7 @@ public class JobBoss : GlobalBase
/// </summary>
public bool ContainsJobLike(Job job)
{
if (job is DownloadChapter dcJob)
{
return this.GetJobsLike(dcJob.mangaConnector, chapter: dcJob.chapter).Any();
}else if (job is DownloadNewChapters ncJob)
{
return this.GetJobsLike(ncJob.mangaConnector, ncJob.manga).Any();
}
return false;
return this.jobs.Any(existingJob => existingJob.Equals(job));
}
public void RemoveJob(Job job)