From 6d74c83ddb983c30ae5ab2ffe0a403d0e07b5198 Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Thu, 18 Nov 2021 12:07:27 +0800 Subject: [PATCH] Fix issues mentioned in review, except for option name Signed-off-by: Petrus.Z --- .../Library/Validators/CollectionPostScanTask.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs index fece37b036..cd9e109ffe 100644 --- a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs @@ -54,9 +54,10 @@ namespace Emby.Server.Implementations.Library.Validators Recursive = true }); - var collectionNameMoviesMap = new Dictionary>(); + var collectionNameMoviesMap = new Dictionary>(); - foreach (var library in _libraryManager.RootFolder.Children.ToList()) { + foreach (var library in _libraryManager.RootFolder.Children) + { if (!_libraryManager.GetLibraryOptions(library).AutoCollection) { continue; } @@ -67,7 +68,6 @@ namespace Emby.Server.Implementations.Library.Validators IncludeItemTypes = new[] { nameof(Movie) }, IsVirtualItem = false, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) }, - SourceTypes = new[] { SourceType.Library }, Parent = library, Recursive = true }); @@ -78,14 +78,14 @@ namespace Emby.Server.Implementations.Library.Validators { if (collectionNameMoviesMap.TryGetValue(movie.CollectionName, out var movieList)) { - if (!movieList.Any(m => m == movie.Id)) + if (!movieList.Contains(movie.Id)) { movieList.Add(movie.Id); } } else { - collectionNameMoviesMap[movie.CollectionName] = new List { movie.Id }; + collectionNameMoviesMap[movie.CollectionName] = new HashSet { movie.Id }; } } }