From def59f17ddff69c43132d1a3aaa5027bbac87d23 Mon Sep 17 00:00:00 2001 From: sentriz Date: Sat, 25 Nov 2023 14:36:58 +0000 Subject: [PATCH] chore(jukebox): gracefully handle jukebox request when not enabled --- server/ctrlsubsonic/handlers_common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/ctrlsubsonic/handlers_common.go b/server/ctrlsubsonic/handlers_common.go index e41d0f5e..edc35edc 100644 --- a/server/ctrlsubsonic/handlers_common.go +++ b/server/ctrlsubsonic/handlers_common.go @@ -332,6 +332,10 @@ func (c *Controller) ServeGetRandomSongs(r *http.Request) *spec.Response { var errNotATrack = errors.New("not a track") 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) trackPaths := func(ids []specid.ID) ([]string, error) { var paths []string