GetCoverArt returns placeholder if id is missing

This mimics Subsonic behaviour, even if it contradicts the API documentation, which states `id` is required

Fixes #1139
This commit is contained in:
Deluan 2021-05-29 11:37:00 -04:00
parent 7bbb09e546
commit 91a91f7e06
4 changed files with 26 additions and 6 deletions

View file

@ -11,6 +11,14 @@ func ParamString(r *http.Request, param string) string {
return r.URL.Query().Get(param)
}
func ParamStringDefault(r *http.Request, param, def string) string {
v := ParamString(r, param)
if v == "" {
return def
}
return v
}
func ParamStrings(r *http.Request, param string) []string {
return r.URL.Query()[param]
}