diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-08-05 18:39:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-05 18:39:55 -0400 |
| commit | 17b0453cfb4176157b234795ba5ac94fdc1c86a0 (patch) | |
| tree | 7661313c2238c758c620ea5272c1fd0404eb295b /Emby.Server.Implementations/Library/Search/SearchManager.cs | |
| parent | d5a5b56484103e20bf36c558439048aa8f85c259 (diff) | |
| parent | 61e75599b30cd346eab743529271ab3e002f0474 (diff) | |
Merge pull request #17466 from Shadowghost/fix-byname-queries
Improve People deduplication, fix search and restrict ItemByName responses
Diffstat (limited to 'Emby.Server.Implementations/Library/Search/SearchManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/Search/SearchManager.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Library/Search/SearchManager.cs b/Emby.Server.Implementations/Library/Search/SearchManager.cs index a5be3f07bd..01f9062734 100644 --- a/Emby.Server.Implementations/Library/Search/SearchManager.cs +++ b/Emby.Server.Implementations/Library/Search/SearchManager.cs @@ -118,7 +118,7 @@ public class SearchManager : ISearchManager var user = _userManager.GetUserById(query.UserId.Value); if (user is not null) { - results = await FilterByUserAccessAsync(results, user, cancellationToken).ConfigureAwait(false); + results = await FilterByUserAccessAsync(results, user, query, cancellationToken).ConfigureAwait(false); } } @@ -128,13 +128,14 @@ public class SearchManager : ISearchManager private async Task<IReadOnlyList<SearchResult>> FilterByUserAccessAsync( IReadOnlyList<SearchResult> candidates, User user, + SearchProviderQuery query, CancellationToken cancellationToken) { - // SetUser populates parental rating + blocked/allowed tags. ConfigureUserAccess populates - // TopParentIds for the user's accessible libraries — we call it before assigning ItemIds - // because LibraryManager.AddUserToQuery skips TopParentIds when ItemIds is non-empty. - var accessFilter = new InternalItemsQuery(user); - _libraryManager.ConfigureUserAccess(accessFilter, user); + // SetUser populates parental rating + blocked/allowed tags, Build populates TopParentIds + // for the user's accessible libraries. The candidate ids are applied to the query below + // rather than to the filter because LibraryManager.AddUserToQuery skips TopParentIds when + // ItemIds is non-empty. + var accessFilter = SearchQueryAccessFilter.Build(user, query, _libraryManager); Guid[] candidateIds = [.. candidates.Select(c => c.ItemId)]; |
