From cc82ca189fcbd068c34c0d1c38a67d2332a96d44 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Tue, 27 Jun 2023 21:19:15 -0600 Subject: [PATCH] suggestions from review --- .../ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs index f8b044d46f..f78fc6f970 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs @@ -74,11 +74,12 @@ public class CleanupCollectionPathsTask : IScheduledTask var collections = collectionsFolder.Children.OfType().ToArray(); _logger.LogDebug("Found {CollectionLength} Boxsets", collections.Length); + var itemsToRemove = new List(); for (var index = 0; index < collections.Length; index++) { var collection = collections[index]; _logger.LogDebug("Check Boxset {CollectionName}", collection.Name); - var itemsToRemove = new List(); + foreach (var collectionLinkedChild in collection.LinkedChildren) { if (!File.Exists(collectionLinkedChild.Path)) @@ -102,6 +103,8 @@ public class CleanupCollectionPathsTask : IScheduledTask ForceSave = true }, RefreshPriority.High); + + itemsToRemove.Clear(); } progress.Report(100D / collections.Length * (index + 1));