Add support for filtering boxsets by parentId

This commit is contained in:
Shadowghost
2026-05-20 11:34:45 +02:00
parent 2b2db76948
commit 9dfcc0918f
3 changed files with 24 additions and 0 deletions

View File

@@ -1027,6 +1027,15 @@ public sealed partial class BaseItemRepository
baseQuery = baseQuery.Where(e => e.Parents!.AsQueryable().Any(ancestorFilter));
}
if (filter.LinkedChildAncestorIds.Length > 0)
{
// Keep folder-like items (BoxSets, Playlists) whose linked children descend from any of the requested ancestor ids.
var linkedChildAncestorIds = filter.LinkedChildAncestorIds;
baseQuery = baseQuery.Where(e => context.LinkedChildren.Any(lc =>
lc.ParentId == e.Id
&& lc.Child!.Parents!.Any(a => linkedChildAncestorIds.Contains(a.ParentItemId))));
}
if (!string.IsNullOrWhiteSpace(filter.AncestorWithPresentationUniqueKey))
{
baseQuery = baseQuery