Backport pull request #15423 from jellyfin/release-10.11.z

Invalidate parent folder's cache on deletion/creation

Original-merge: 49efd68fc7

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
theguymadmax 2025-11-17 14:08:57 -05:00 committed by Bond_009
parent 5a30f108fe
commit e34e7a1d0b

View file

@ -457,6 +457,12 @@ namespace Emby.Server.Implementations.Library
_cache.TryRemove(child.Id, out _);
}
if (parent is Folder folder)
{
folder.Children = null;
folder.UserData = null;
}
ReportItemRemoved(item, parent);
}
@ -1993,6 +1999,12 @@ namespace Emby.Server.Implementations.Library
RegisterItem(item);
}
if (parent is Folder folder)
{
folder.Children = null;
folder.UserData = null;
}
if (ItemAdded is not null)
{
foreach (var item in items)
@ -2150,6 +2162,12 @@ namespace Emby.Server.Implementations.Library
_itemRepository.SaveItems(items, cancellationToken);
if (parent is Folder folder)
{
folder.Children = null;
folder.UserData = null;
}
if (ItemUpdated is not null)
{
foreach (var item in items)