Closed peterjuras closed 2 years ago
Replacing tracks in a playlist should work using the spotifyApi.playlists.reorderItems(...) API.
spotifyApi.playlists.reorderItems(...)
Replacing tracks no longer works, because there is a wrong body property uri instead of uris (plural)
uri
uris
This is likely because in this line the uri parameter is used instead of uris. (See Spotify API reference)
const spotifyApi = await Client.create({ token: { clientID: SPOTIFY_CLIENT_ID, clientSecret: SPOTIFY_CLIENT_SECRET, refreshToken: spotifyUser.refreshToken, }, userAuthorizedToken: true, refreshToken: true, }); const playlistId = "VALID PLAYLIST ID" const trackUris = ['VALID TRACK URIS'] await spotifyApi.playlists.reorderItems(playlistId, { uris: trackUris, });
Node Version: 16.15.1
Library Version: 9.2.2
[X] I have already checked issues regarding this bug.
[X] This problem is generated due to version migration.
I created pull request #158 which solves this issue.
Bug Report
What i expected:
Replacing tracks in a playlist should work using the
spotifyApi.playlists.reorderItems(...)
API.What actually happened:
Replacing tracks no longer works, because there is a wrong body property
uri
instead ofuris
(plural)This is likely because in this line the
uri
parameter is used instead ofuris
. (See Spotify API reference)To reproduce this bug:
Node Version: 16.15.1
Library Version: 9.2.2
[X] I have already checked issues regarding this bug.
[X] This problem is generated due to version migration.