aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjgriff6 <74262798+jgriff6@users.noreply.github.com>2022-10-25 01:40:47 +0100
committerjgriff6 <74262798+jgriff6@users.noreply.github.com>2022-10-25 02:27:13 +0100
commit08e71010ae3370cb51068eb0215d53f82019fbca (patch)
tree49e2cac4afc8358f9a19632bdca22d0d2f5d7dd2
parent5cd37686ac43c5595e63dfc47bfaf339f2be3271 (diff)
Clean up some ToList usage
-rw-r--r--Emby.Naming/AudioBook/AudioBookListResolver.cs3
-rw-r--r--Emby.Server.Implementations/Collections/CollectionManager.cs5
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs3
3 files changed, 8 insertions, 3 deletions
diff --git a/Emby.Naming/AudioBook/AudioBookListResolver.cs b/Emby.Naming/AudioBook/AudioBookListResolver.cs
index 4a464f8f4..6e491185d 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.cs
index 213c3dccc..187e0c9b3 100644
--- a/Emby.Server.Implementations/Collections/CollectionManager.cs
+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs
@@ -232,7 +232,10 @@ namespace Emby.Server.Implementations.Collections
if (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.cs
index c2a1f4dde..cef82ebbc 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)
{