Clean up some ToList usage

pull/8618/head
jgriff6 2 years ago
parent 5cd37686ac
commit 08e71010ae

@ -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);

@ -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);

@ -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)
{

Loading…
Cancel
Save