mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-13 08:37:07 +00:00
Fix version filters
This commit is contained in:
parent
d5f4c624e3
commit
6fdfc6a61b
2 changed files with 7 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -721,10 +721,10 @@ public sealed partial class BaseItemRepository
|
|||
}
|
||||
else if (filter.OwnerIds.Length == 0 && filter.ExtraTypes.Length == 0 && !filter.IncludeOwnedItems)
|
||||
{
|
||||
// Exclude alternate versions from general queries. Alternate versions have
|
||||
// OwnerId set (pointing to their primary) but no ExtraType.
|
||||
// Extras (trailers, etc.) also have OwnerId but DO have ExtraType set - keep those.
|
||||
baseQuery = baseQuery.Where(e => e.OwnerId == null || e.ExtraType != null);
|
||||
// Exclude alternate versions and owned non-extra items from general queries.
|
||||
// Alternate versions have PrimaryVersionId set (pointing to their primary).
|
||||
// Extras (trailers, etc.) have OwnerId set but also have ExtraType set - keep those.
|
||||
baseQuery = baseQuery.Where(e => e.PrimaryVersionId == null && (e.OwnerId == null || e.ExtraType != null));
|
||||
}
|
||||
|
||||
if (filter.OwnerIds.Length > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue