From 6fdfc6a61b705191a23cf05d6648ace5607ab197 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Mon, 30 Mar 2026 19:49:36 +0200 Subject: Fix version filters --- .../Item/BaseItemRepository.QueryBuilding.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Jellyfin.Server.Implementations/Item/BaseItemRepository.QueryBuilding.cs') diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.QueryBuilding.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.QueryBuilding.cs index 22a03dafa7..812b6ab59c 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.QueryBuilding.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.QueryBuilding.cs @@ -439,11 +439,11 @@ public sealed partial class BaseItemRepository || (e.TopParentId.HasValue && f.ItemId == e.TopParentId.Value)))); } - // Exclude alternate versions from counts. Alternate versions have - // OwnerId set (pointing to their primary) but no ExtraType. + // Exclude alternate versions and owned non-extra items from counts. + // Alternate versions have PrimaryVersionId set (pointing to their primary). if (!filter.IncludeOwnedItems) { - baseQuery = baseQuery.Where(e => e.OwnerId == null || e.ExtraType != null); + baseQuery = baseQuery.Where(e => e.PrimaryVersionId == null && (e.OwnerId == null || e.ExtraType != null)); } return baseQuery; -- cgit v1.2.3