chore(jukebox): gracefully handle jukebox request when not enabled
This commit is contained in:
@@ -332,6 +332,10 @@ func (c *Controller) ServeGetRandomSongs(r *http.Request) *spec.Response {
|
|||||||
var errNotATrack = errors.New("not a track")
|
var errNotATrack = errors.New("not a track")
|
||||||
|
|
||||||
func (c *Controller) ServeJukebox(r *http.Request) *spec.Response { // nolint:gocyclo
|
func (c *Controller) ServeJukebox(r *http.Request) *spec.Response { // nolint:gocyclo
|
||||||
|
if c.jukebox == nil {
|
||||||
|
return spec.NewError(0, "jukebox not enabled")
|
||||||
|
}
|
||||||
|
|
||||||
params := r.Context().Value(CtxParams).(params.Params)
|
params := r.Context().Value(CtxParams).(params.Params)
|
||||||
trackPaths := func(ids []specid.ID) ([]string, error) {
|
trackPaths := func(ids []specid.ID) ([]string, error) {
|
||||||
var paths []string
|
var paths []string
|
||||||
|
|||||||
Reference in New Issue
Block a user