aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2024-05-11 11:05:56 -0400
committerGitHub <noreply@github.com>2024-05-11 11:05:56 -0400
commitafd1d3be32de7e7f321bf5911a18bc14df5bc51c (patch)
tree53f8a63f695dbbd59a953e768f95d9fdb9adfd2b
parent145dc31ccb3634290fee151afb8557feaf2c3220 (diff)
parent47b79df1360154fa3396904f1eb62f7f73be7a01 (diff)
Merge pull request #11526 from jellyfin/don't-assume-library-change-only-on-item-count
Use actual item removal count for library change determination
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index f39fa79eb..236e47f95 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -421,13 +421,12 @@ namespace MediaBrowser.Controller.Entities
validChildren.Add(child);
}
+ // That's all the new and changed ones - now see if any have been removed and need cleanup
+ var itemsRemoved = currentChildren.Values.Except(validChildren).ToList();
var shouldRemove = !IsRoot || allowRemoveRoot;
// If it's an AggregateFolder, don't remove
- if (shouldRemove && currentChildren.Count != validChildren.Count)
+ if (shouldRemove && itemsRemoved.Count > 0)
{
- // That's all the new and changed ones - now see if there are any that are missing
- var itemsRemoved = currentChildren.Values.Except(validChildren).ToList();
-
foreach (var item in itemsRemoved)
{
if (item.IsFileProtocol)