support subsonic bookmarks

This commit is contained in:
sentriz
2021-02-03 22:51:16 +00:00
parent f027d5a486
commit 7a1d57a43c
7 changed files with 168 additions and 42 deletions

View File

@@ -153,9 +153,12 @@ func (c *Controller) ServeSavePlayQueue(r *http.Request) *spec.Response {
if err != nil {
return spec.NewError(10, "please provide some `id` parameters")
}
// TODO: support other play queue entries other than tracks
trackIDs := make([]int, 0, len(tracks))
for _, id := range tracks {
trackIDs = append(trackIDs, id.Value)
if id.Type == specid.Track {
trackIDs = append(trackIDs, id.Value)
}
}
user := r.Context().Value(CtxUser).(*db.User)
queue := &db.PlayQueue{UserID: user.ID}