Fix recursive handling for LinkedChildren

This commit is contained in:
Shadowghost
2026-08-31 17:56:56 +02:00
parent 420d44f638
commit 7ccce8e0e7
4 changed files with 160 additions and 12 deletions
@@ -1091,6 +1091,12 @@ public sealed partial class BaseItemRepository
baseQuery = baseQuery.Where(e => e.Parents!.AsQueryable().Any(ancestorFilter));
}
if (filter.DescendantOfId.HasValue)
{
var descendantIds = DescendantQueryHelper.GetAllDescendantIds(context, filter.DescendantOfId.Value);
baseQuery = baseQuery.Where(e => descendantIds.Contains(e.Id));
}
if (filter.LinkedChildAncestorIds.Length > 0)
{
// Keep folder-like items (BoxSets, Playlists) whose linked children descend from any of the requested ancestor ids.