Merge pull request #8618 from jgriff6/remove-tolists

This commit is contained in:
Bond-009
2022-10-30 14:19:07 +01:00
committed by GitHub
7 changed files with 12 additions and 34 deletions

View File

@@ -232,10 +232,10 @@ namespace Emby.Server.Implementations.Collections
if (list.Count > 0)
{
var newList = collection.LinkedChildren.ToList();
newList.AddRange(list);
collection.LinkedChildren = newList.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);

View File

@@ -115,7 +115,7 @@ namespace Emby.Server.Implementations.EntryPoints
{
}
var collectionFolders = _libraryManager.GetCollectionFolders(item).ToList();
var collectionFolders = _libraryManager.GetCollectionFolders(item);
foreach (var collectionFolder in collectionFolders)
{

View File

@@ -79,14 +79,6 @@ namespace Emby.Server.Implementations.IO
TemporarilyIgnore(path);
}
public bool IsPathLocked(string path)
{
// This method is not used by the core but it used by auto-organize
var lockedPaths = _tempIgnoredPaths.Keys.ToList();
return lockedPaths.Any(i => _fileSystem.AreEqual(i, path) || _fileSystem.ContainsSubPath(i, path));
}
public async void ReportFileSystemChangeComplete(string path, bool refreshPath)
{
if (string.IsNullOrEmpty(path))
@@ -145,8 +137,7 @@ namespace Emby.Server.Implementations.IO
.OfType<Folder>()
.SelectMany(f => f.PhysicalLocations)
.Distinct(StringComparer.OrdinalIgnoreCase)
.OrderBy(i => i)
.ToList();
.OrderBy(i => i);
foreach (var path in paths)
{
@@ -372,11 +363,8 @@ namespace Emby.Server.Implementations.IO
var monitorPath = !IgnorePatterns.ShouldIgnore(path);
// Ignore certain files
var tempIgnorePaths = _tempIgnoredPaths.Keys.ToList();
// If the parent of an ignored path has a change event, ignore that too
if (tempIgnorePaths.Any(i =>
// Ignore certain files, If the parent of an ignored path has a change event, ignore that too
if (_tempIgnoredPaths.Keys.Any(i =>
{
if (_fileSystem.AreEqual(i, path))
{
@@ -491,7 +479,7 @@ namespace Emby.Server.Implementations.IO
{
lock (_activeRefreshers)
{
foreach (var refresher in _activeRefreshers.ToList())
foreach (var refresher in _activeRefreshers)
{
refresher.Completed -= OnNewRefresherCompleted;
refresher.Dispose();