use ffprobe
This commit is contained in:
@@ -34,9 +34,9 @@ func respondRaw(w http.ResponseWriter, r *http.Request, code int, sub *subsonic.
|
||||
log.Printf("could not marshall to json: %v\n", err)
|
||||
}
|
||||
callback := r.URL.Query().Get("callback")
|
||||
w.Write([]byte(fmt.Sprintf("%s(", callback)))
|
||||
w.Write([]byte(fmt.Sprintf(`%s({"subsonic-response":`, callback)))
|
||||
w.Write(data)
|
||||
w.Write([]byte(");"))
|
||||
w.Write([]byte("});"))
|
||||
default:
|
||||
w.Header().Set("Content-Type", "application/xml")
|
||||
data, err := xml.Marshal(sub)
|
||||
|
||||
@@ -44,7 +44,9 @@ func (c *Controller) CheckParameters(next http.HandlerFunc) http.HandlerFunc {
|
||||
if param != "" {
|
||||
continue
|
||||
}
|
||||
respondError(w, r, 10, fmt.Sprintf("please provide a `%s` parameter", req))
|
||||
respondError(w, r,
|
||||
10, fmt.Sprintf("please provide a `%s` parameter", req),
|
||||
)
|
||||
return
|
||||
}
|
||||
username := r.URL.Query().Get("u")
|
||||
@@ -54,7 +56,9 @@ func (c *Controller) CheckParameters(next http.HandlerFunc) http.HandlerFunc {
|
||||
passwordAuth := token == "" && salt == ""
|
||||
tokenAuth := password == ""
|
||||
if tokenAuth == passwordAuth {
|
||||
respondError(w, r, 10, "please provide parameters `t` and `s`, or just `p`")
|
||||
respondError(w, r,
|
||||
10, "please provide parameters `t` and `s`, or just `p`",
|
||||
)
|
||||
return
|
||||
}
|
||||
user := db.User{
|
||||
|
||||
Reference in New Issue
Block a user