mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-23 09:07:02 +01:00
Add support for filtering boxsets by parentId
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user