diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-10-24 09:56:04 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-10-24 09:56:04 +0200 |
| commit | d95c2e1425d0d902e8191260ba9151f686aa2650 (patch) | |
| tree | 3bc937664dcf9fe8d7659b00d92fc3a6c61be805 /Emby.Server.Implementations/Library/Search/SearchManager.cs | |
| parent | d3a92c69f8c1c5d1cda803a35f03175d6ba3b091 (diff) | |
| parent | c7ce6a1b56ee7dcc1896250df0f2f9deaa828a81 (diff) | |
Merge branch 'master' into port-async-migration-routines
# Conflicts:
# Jellyfin.Server/Migrations/Routines/20260915120000_MigrateRatingLevels.cs
Diffstat (limited to 'Emby.Server.Implementations/Library/Search/SearchManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/Search/SearchManager.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Library/Search/SearchManager.cs b/Emby.Server.Implementations/Library/Search/SearchManager.cs index 306a8673d5..a8ee416b31 100644 --- a/Emby.Server.Implementations/Library/Search/SearchManager.cs +++ b/Emby.Server.Implementations/Library/Search/SearchManager.cs @@ -143,11 +143,19 @@ public class SearchManager : ISearchManager baseQuery = _queryHelpers.ApplyAccessFiltering(dbContext, baseQuery, accessFilter); - var allowedIds = await baseQuery - .Select(e => e.Id) - .ToHashSetAsync(cancellationToken) + var allowed = await baseQuery + .Select(e => new { e.Id, e.PrimaryVersionId }) + .ToListAsync(cancellationToken) .ConfigureAwait(false); + var allowedIds = allowed.Select(e => e.Id).ToHashSet(); + + // A provider can return both an alternate version and the primary it belongs to, and the + // two are one item to the user. + allowedIds.ExceptWith(allowed + .Where(e => e.PrimaryVersionId.HasValue && allowedIds.Contains(e.PrimaryVersionId.Value)) + .Select(e => e.Id)); + if (allowedIds.Count == candidates.Count) { return candidates; |
