From d47d5e17e91d1775e3c6f16d900ba3b565401393 Mon Sep 17 00:00:00 2001 From: sentriz Date: Sat, 8 Oct 2022 17:23:12 +0100 Subject: [PATCH] fix(subsonic): return an error when no tracks provided in savePlayQueue --- server/ctrlsubsonic/handlers_common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/ctrlsubsonic/handlers_common.go b/server/ctrlsubsonic/handlers_common.go index 9d7349af..a2dded46 100644 --- a/server/ctrlsubsonic/handlers_common.go +++ b/server/ctrlsubsonic/handlers_common.go @@ -169,6 +169,9 @@ func (c *Controller) ServeSavePlayQueue(r *http.Request) *spec.Response { trackIDs = append(trackIDs, id.Value) } } + if len(trackIDs) == 0 { + return spec.NewError(10, "no track ids provided") + } user := r.Context().Value(CtxUser).(*db.User) var queue db.PlayQueue c.DB.Where("user_id=?", user.ID).First(&queue)