From 6a317f45ce5def14b4feccc4ae84f2e27441b997 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Tue, 15 Sep 2026 11:16:09 -0400 Subject: Backport pull request #17950 from jellyfin/release-12.z Fix collection creation when the collections library was just added Original-merge: 3c698bab7fb7c607e726a0bf79f0bb0f7616e962 Merged-by: crobibero Backported-by: Cody Robibero --- MediaBrowser.Controller/Entities/AggregateFolder.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'MediaBrowser.Controller/Entities/AggregateFolder.cs') diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs index a02802f41e..bb770fc6f3 100644 --- a/MediaBrowser.Controller/Entities/AggregateFolder.cs +++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs @@ -54,6 +54,23 @@ namespace MediaBrowser.Controller.Entities public string[] PhysicalLocationsList { get; set; } + // Children caches the resolved items, _childrenIds the ids they were loaded from. Clearing + // only the former sends the next read back through LoadChildren, which replays the stale + // id list, so a caller invalidating this folder has to drop both. + public override IEnumerable Children + { + get => base.Children; + set + { + if (value is null) + { + ClearCache(); + } + + base.Children = value; + } + } + public override bool CanDelete() { return false; -- cgit v1.2.3