Skip to content

Commit afd1d3b

Browse files
Merge pull request jellyfin#11526 from jellyfin/don't-assume-library-change-only-on-item-count
Use actual item removal count for library change determination
2 parents 145dc31 + 47b79df commit afd1d3b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

MediaBrowser.Controller/Entities/Folder.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,12 @@ private async Task ValidateChildrenInternal2(IProgress<double> progress, bool re
421421
validChildren.Add(child);
422422
}
423423

424+
// That's all the new and changed ones - now see if any have been removed and need cleanup
425+
var itemsRemoved = currentChildren.Values.Except(validChildren).ToList();
424426
var shouldRemove = !IsRoot || allowRemoveRoot;
425427
// If it's an AggregateFolder, don't remove
426-
if (shouldRemove && currentChildren.Count != validChildren.Count)
428+
if (shouldRemove && itemsRemoved.Count > 0)
427429
{
428-
// That's all the new and changed ones - now see if there are any that are missing
429-
var itemsRemoved = currentChildren.Values.Except(validChildren).ToList();
430-
431430
foreach (var item in itemsRemoved)
432431
{
433432
if (item.IsFileProtocol)

0 commit comments

Comments
 (0)