2
0

Fixed wrong comparison on add new task

This commit is contained in:
glax 2023-06-06 21:56:51 +02:00
parent cf6fc3b8f6
commit 5099e25f3f

View File

@ -152,9 +152,9 @@ public class TaskManager
case TrangaTask.Task.DownloadNewChapters: case TrangaTask.Task.DownloadNewChapters:
IEnumerable<TrangaTask> matchingdnc = IEnumerable<TrangaTask> matchingdnc =
_allTasks.Where(mTask => mTask.GetType() == typeof(DownloadNewChaptersTask)); _allTasks.Where(mTask => mTask.GetType() == typeof(DownloadNewChaptersTask));
if (matchingdnc.All(mTask => if (!matchingdnc.Any(mTask =>
((DownloadNewChaptersTask)mTask).publication.internalId != ((DownloadNewChaptersTask)newTask).publication.publicationId && ((DownloadNewChaptersTask)mTask).publication.internalId == ((DownloadNewChaptersTask)newTask).publication.internalId &&
((DownloadNewChaptersTask)mTask).connectorName != ((DownloadNewChaptersTask)newTask).connectorName)) ((DownloadNewChaptersTask)mTask).connectorName == ((DownloadNewChaptersTask)newTask).connectorName))
_allTasks.Add(newTask); _allTasks.Add(newTask);
else else
logger?.WriteLine(this.GetType().ToString(), $"Task already exists {newTask}"); logger?.WriteLine(this.GetType().ToString(), $"Task already exists {newTask}");