-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlibrary.go
More file actions
24 lines (19 loc) · 752 Bytes
/
library.go
File metadata and controls
24 lines (19 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package spotify
import (
"net/url"
"strings"
)
// SaveTracks saves one or more tracks to the current user's 'Your Music' library.
// https://developer.spotify.com/documentation/web-api/reference/#endpoint-save-tracks-user
func (a *API) SaveTracks(ids ...string) error {
query := make(url.Values)
query.Add("ids", strings.Join(ids, ","))
return a.put("v1", "/me/tracks", query, nil)
}
// RemoveSavedTracks removes one or more tracks from the current user's 'Your Music' library.
// https://developer.spotify.com/documentation/web-api/reference/#endpoint-remove-tracks-user
func (a *API) RemoveSavedTracks(ids ...string) error {
query := make(url.Values)
query.Add("ids", strings.Join(ids, ","))
return a.delete("v1", "/me/tracks", query)
}