mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-06-29 02:13:36 +02:00
Don't assume library change only on item count
The library will also be updated when the number of children remains the same before and after scanning. For example, if one video file is removed and replaced with another version, we still need to remove the old one in this case. Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
parent
145dc31ccb
commit
588fb9e82b
|
@ -421,13 +421,12 @@ namespace MediaBrowser.Controller.Entities
|
|||
validChildren.Add(child);
|
||||
}
|
||||
|
||||
// That's all the new and changed ones - now see if there are any that are missing
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue