fix: add global adult library visibility controls

This commit is contained in:
ShukeBta
2026-05-30 03:24:08 +08:00
parent ce8ffabba7
commit 99ecae0c44
17 changed files with 208 additions and 37 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ func recentMediaHandler(svc *service.Container) gin.HandlerFunc {
if limit <= 0 || limit > 100 {
limit = 12
}
var items []model.Media
if err := svc.Repo.DB.Order("created_at desc").Limit(limit).Find(&items).Error; err != nil {
items, err := svc.Media.SearchMediaVisible(c.Request.Context(), "", limit, mediaVisibilityForRequest(c, svc))
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}