Skip to content

Commit

Permalink
fix playlist adding bg
Browse files Browse the repository at this point in the history
  • Loading branch information
charliet committed Aug 12, 2019
1 parent 0505e1e commit 86925b8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/playlists.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,10 @@ create_playlist <- function(user_id, name, public = TRUE, collaborative = FALSE,

add_tracks_to_playlist <- function(playlist_id, uris, position = NULL, authorization = get_spotify_authorization_code()) {
base_url <- 'https://api.spotify.com/v1/playlists'
url <- str_glue('{base_url}/{playlist_id}/tracks')
url <- str_glue('{base_url}/{playlist_id}/tracks?uris={paste0(uris, collapse = ",")}')
params <- list(
uris = uris,
position = position
)
cat(url)
res <- RETRY('POST', url, body = params, config(token = authorization), encode = 'json')
stop_for_status(res)
res <- fromJSON(content(res, as = 'text', encoding = 'UTF-8'), flatten = TRUE)
Expand Down

0 comments on commit 86925b8

Please sign in to comment.