The Free Software Media System - Server Backend & API
Avoid multiple enumerations
Tobias Kloy7717d2e26171
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex 6a19a41cd6..c6b8501cbc 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -2721,9 +2721,11 @@ namespace Emby.Server.Implementations.Libraryif (current.IsDirectory && _namingOptions.AllExtrasTypesFolderNames.ContainsKey(current.Name)){var filesInSubFolder = _fileSystem.GetFiles(current.FullName, null, false, false);- bool subFolderIsMixedFolder = filesInSubFolder.Count() > 1;+ var filesInSubFolderList = filesInSubFolder.ToList();- foreach (var file in filesInSubFolder)+ bool subFolderIsMixedFolder = filesInSubFolderList.Count > 1;++ foreach (var file in filesInSubFolderList){if (!_extraResolver.TryGetExtraTypeForOwner(file.FullName, ownerVideoInfo, out var extraType)){