From 2c8e647a04115400d58f3bfff6221f42327d923e Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 20 May 2023 01:30:34 +0200 Subject: [PATCH] Simplification --- Tranga/TaskExecutor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tranga/TaskExecutor.cs b/Tranga/TaskExecutor.cs index 1670ed2..0f44a18 100644 --- a/Tranga/TaskExecutor.cs +++ b/Tranga/TaskExecutor.cs @@ -93,8 +93,7 @@ public static class TaskExecutor private static List UpdateChapters(Connector connector, Publication publication, string language, Dictionary> chapterCollection) { List newChaptersList = new(); - if (!chapterCollection.ContainsKey(publication)) - return newChaptersList; + chapterCollection.TryAdd(publication, newChaptersList); //To ensure publication is actually in collection Chapter[] newChapters = connector.GetChapters(publication, language); newChaptersList = newChapters.Where(nChapter => !connector.ChapterIsDownloaded(publication, nChapter)).ToList();