This commit is contained in:
truewhile
2026-08-28 22:20:01 +08:00
parent e365250440
commit c30dab56a3
7 changed files with 222 additions and 23 deletions
+10
View File
@@ -45,6 +45,16 @@ func listLibrariesHandler(svc *service.Container) gin.HandlerFunc {
}
libs = filtered
}
withPreview := c.Query("with_preview") == "1" || c.Query("with_preview") == "true"
if withPreview {
previews, err := svc.Media.ListLibrariesWithPreview(c.Request.Context(), libs, mediaVisibilityForRequest(c, svc), 10)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, previews)
return
}
c.JSON(http.StatusOK, libs)
}
}