fix(subsonic): return an error when no tracks provided in savePlayQueue

This commit is contained in:
sentriz
2022-10-08 17:23:12 +01:00
parent 8ee357b021
commit d47d5e17e9

View File

@@ -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)