From 84dbc36bbf3418e4983cb2ba6b6ae8d7ac0680fe Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 21 May 2023 21:23:51 +0200 Subject: [PATCH] dont add duplicates --- Tranga/TaskManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index 2fb421d..76dffd1 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -231,8 +231,11 @@ public class TaskManager public Publication[] GetPublicationsFromConnector(Connector connector, string? title = null) { Publication[] ret = connector.GetPublications(title ?? ""); - foreach(Publication publication in ret) - this._chapterCollection.TryAdd(publication, new List()); + foreach (Publication publication in ret) + { + if(!_chapterCollection.Any(pub => pub.Key.sortName == publication.sortName)) + this._chapterCollection.TryAdd(publication, new List()); + } return ret; }