fix: hide adult libraries across dashboard views

This commit is contained in:
ShukeBta
2026-05-30 03:50:52 +08:00
parent e8c2cf1ea4
commit d35086f49d
8 changed files with 241 additions and 15 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ func listLibrariesHandler(svc *service.Container) gin.HandlerFunc {
return
}
role, _ := c.Get(middleware.CtxUserRole)
if role != "admin" {
includeHidden := role == "admin" && (c.Query("include_hidden") == "1" || c.Query("all") == "1")
if !includeHidden {
visibility := mediaVisibilityForRequest(c, svc)
filtered := libs[:0]
for _, lib := range libs {