Replace all utils.Param* with req.Params
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
"github.com/navidrome/navidrome/model/request"
|
||||
"github.com/navidrome/navidrome/server/public"
|
||||
"github.com/navidrome/navidrome/server/subsonic/responses"
|
||||
"github.com/navidrome/navidrome/utils"
|
||||
)
|
||||
|
||||
func newResponse() *responses.Subsonic {
|
||||
@@ -27,30 +26,6 @@ func newResponse() *responses.Subsonic {
|
||||
}
|
||||
}
|
||||
|
||||
func requiredParamString(r *http.Request, param string) (string, error) {
|
||||
p := utils.ParamString(r, param)
|
||||
if p == "" {
|
||||
return "", newError(responses.ErrorMissingParameter, "required '%s' parameter is missing", param)
|
||||
}
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func requiredParamStrings(r *http.Request, param string) ([]string, error) {
|
||||
ps := utils.ParamStrings(r, param)
|
||||
if len(ps) == 0 {
|
||||
return nil, newError(responses.ErrorMissingParameter, "required '%s' parameter is missing", param)
|
||||
}
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
func requiredParamInt(r *http.Request, param string) (int, error) {
|
||||
p := utils.ParamString(r, param)
|
||||
if p == "" {
|
||||
return 0, newError(responses.ErrorMissingParameter, "required '%s' parameter is missing", param)
|
||||
}
|
||||
return utils.ParamInt(r, param, 0), nil
|
||||
}
|
||||
|
||||
type subError struct {
|
||||
code int
|
||||
messages []interface{}
|
||||
|
||||
Reference in New Issue
Block a user