Simplification

This commit is contained in:
glax 2023-05-20 01:30:34 +02:00
parent 9d583b284a
commit 2c8e647a04

View File

@ -93,8 +93,7 @@ public static class TaskExecutor
private static List<Chapter> UpdateChapters(Connector connector, Publication publication, string language, Dictionary<Publication, List<Chapter>> chapterCollection) private static List<Chapter> UpdateChapters(Connector connector, Publication publication, string language, Dictionary<Publication, List<Chapter>> chapterCollection)
{ {
List<Chapter> newChaptersList = new(); List<Chapter> newChaptersList = new();
if (!chapterCollection.ContainsKey(publication)) chapterCollection.TryAdd(publication, newChaptersList); //To ensure publication is actually in collection
return newChaptersList;
Chapter[] newChapters = connector.GetChapters(publication, language); Chapter[] newChapters = connector.GetChapters(publication, language);
newChaptersList = newChapters.Where(nChapter => !connector.ChapterIsDownloaded(publication, nChapter)).ToList(); newChaptersList = newChapters.Where(nChapter => !connector.ChapterIsDownloaded(publication, nChapter)).ToList();