2
0
Эх сурвалжийг харах

Implement check to hide all libraries when user has no access (#9536)

elmuffo 2 жил өмнө
parent
commit
bb5bf0277a

+ 6 - 0
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -1503,6 +1503,12 @@ namespace Emby.Server.Implementations.Library
                 });
                 });
 
 
                 query.TopParentIds = userViews.SelectMany(i => GetTopParentIdsForQuery(i, user)).ToArray();
                 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() };
+                }
             }
             }
         }
         }