dont add duplicates
This commit is contained in:
parent
455c87b2e1
commit
84dbc36bbf
@ -231,8 +231,11 @@ public class TaskManager
|
|||||||
public Publication[] GetPublicationsFromConnector(Connector connector, string? title = null)
|
public Publication[] GetPublicationsFromConnector(Connector connector, string? title = null)
|
||||||
{
|
{
|
||||||
Publication[] ret = connector.GetPublications(title ?? "");
|
Publication[] ret = connector.GetPublications(title ?? "");
|
||||||
foreach(Publication publication in ret)
|
foreach (Publication publication in ret)
|
||||||
|
{
|
||||||
|
if(!_chapterCollection.Any(pub => pub.Key.sortName == publication.sortName))
|
||||||
this._chapterCollection.TryAdd(publication, new List<Chapter>());
|
this._chapterCollection.TryAdd(publication, new List<Chapter>());
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user