subsonic: make homepageURL parameter optional

By the https://opensubsonic.netlify.app/docs/endpoints/createinternetradiostation/ the `homepageURL` is not requirement option
This commit is contained in:
archekb
2023-08-02 12:08:49 +02:00
committed by GitHub
parent 5fb9c49ed2
commit 8f05f33ab8

View File

@@ -44,7 +44,7 @@ func (c *Controller) ServeCreateInternetRadioStation(r *http.Request) *spec.Resp
return spec.NewError(10, "no name provided: %v", err)
}
homepageURL, err := params.Get("homepageUrl")
if err == nil {
if err == nil && homepageURL != "" {
if _, err := url.ParseRequestURI(homepageURL); err != nil {
return spec.NewError(70, "bad homepage URL provided: %v", err)
}