Fix version filters

This commit is contained in:
Shadowghost
2026-03-30 19:49:36 +02:00
parent d5f4c624e3
commit 6fdfc6a61b
2 changed files with 7 additions and 7 deletions

View File

@@ -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;