From 29fc7711a19f941211cfca9fea586175d5611dd3 Mon Sep 17 00:00:00 2001 From: Alexander Miller Date: Thu, 15 May 2025 11:48:20 +0200 Subject: [PATCH] Merge pull request #14094 from allesmi/fix/ancestor-ids-parent-child-relation Translate query by AncestorIds correctly --- CONTRIBUTORS.md | 1 + Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 938eee0d75..1ff5607eae 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -195,6 +195,7 @@ - [Kenneth Cochran](https://github.com/kennethcochran) - [benedikt257](https://github.com/benedikt257) - [revam](https://github.com/revam) + - [allesmi](https://github.com/allesmi) # Emby Contributors diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index 7d30ac1a07..64c4a92268 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -2191,7 +2191,7 @@ public sealed class BaseItemRepository if (filter.AncestorIds.Length > 0) { - baseQuery = baseQuery.Where(e => e.Children!.Any(f => filter.AncestorIds.Contains(f.ItemId))); + baseQuery = baseQuery.Where(e => e.Parents!.Any(f => filter.AncestorIds.Contains(f.ParentItemId))); } if (!string.IsNullOrWhiteSpace(filter.AncestorWithPresentationUniqueKey))