mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-06 12:26:08 +01:00
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:
parent
5a30f108fe
commit
e34e7a1d0b
1 changed files with 18 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue