diff options
| author | elmuffo <elmuffo@pm.me> | 2023-04-02 09:01:05 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-01 15:01:05 -0600 |
| commit | bb5bf0277ae33fd4668e00bd2f1a85e89aef466a (patch) | |
| tree | 273ace5bef7fee83306050c4d5c3fc6e1167991c /Emby.Server.Implementations/Library/LibraryManager.cs | |
| parent | eb59456e78b11379ba657503f08b1f7c9208f2ae (diff) | |
Implement check to hide all libraries when user has no access (#9536)
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index e5c520ca2..36a300a57 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1503,6 +1503,12 @@ namespace Emby.Server.Implementations.Library }); query.TopParentIds = userViews.SelectMany(i => GetTopParentIdsForQuery(i, user)).ToArray(); + + // Prevent searching in all libraries due to empty filter + if (query.TopParentIds.Length == 0) + { + query.TopParentIds = new[] { Guid.NewGuid() }; + } } } |
