The Free Software Media System - Server Backend & API
Clean up some ToList usage
jgriff608e71010ae33
diff --git a/Emby.Naming/AudioBook/AudioBookListResolver.cs b/Emby.Naming/AudioBook/AudioBookListResolver.csindex 4a464f8f43..6e491185d8 100644--- a/Emby.Naming/AudioBook/AudioBookListResolver.cs+++ b/Emby.Naming/AudioBook/AudioBookListResolver.cs@@ -101,7 +101,8 @@ namespace Emby.Naming.AudioBook{var extra = ex.OrderBy(x => x.Container)- .ThenBy(x => x.Path);+ .ThenBy(x => x.Path)+ .ToList();stackFiles = stackFiles.Except(extra).ToList();extras.AddRange(extra);diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.csindex 213c3dccc2..187e0c9b3b 100644--- a/Emby.Server.Implementations/Collections/CollectionManager.cs+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs@@ -232,7 +232,10 @@ namespace Emby.Server.Implementations.Collectionsif (list.Count > 0){- collection.LinkedChildren = collection.LinkedChildren.Concat(list).ToArray();+ LinkedChild[] newChildren = new LinkedChild[collection.LinkedChildren.Length + list.Count];+ collection.LinkedChildren.CopyTo(newChildren, 0);+ list.CopyTo(newChildren, collection.LinkedChildren.Length);+ collection.LinkedChildren = newChildren;collection.UpdateRatingToItems(linkedChildrenList);await collection.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex c2a1f4dde5..cef82ebbcc 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -615,7 +615,8 @@ namespace Emby.Server.Implementations.Library.Distinct(StringComparer.OrdinalIgnoreCase).ToList();- var dupes = list.Where(subPath => !subPath.EndsWith(":\\", StringComparison.OrdinalIgnoreCase) && list.Any(i => _fileSystem.ContainsSubPath(i, subPath)));+ var dupes = list.Where(subPath => !subPath.EndsWith(":\\", StringComparison.OrdinalIgnoreCase) && list.Any(i => _fileSystem.ContainsSubPath(i, subPath)))+ .ToList();foreach (var dupe in dupes){