JMPerez / spotify-web-api-js

A client-side JS wrapper for the Spotify Web API

Home Page:https://jmperezperez.com/spotify-web-api-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Options not working for `getPlaylistTracks`

eduardoRubioG opened this issue · comments

Describe the bug
Adding an options object to the function getPlaylistTracks seems to have no effect.

To Reproduce

spotifyWebApi.getPlaylistTracks(
      '', // blank string for user id parameter
      'some_playlist_id', 
      { limit: 12, offset: 5 }
    ).then((resp) => {
       console.log(resp); 
}); 

Will correctly console log the playlist information but with the tracks item coming back with the default limit of 100 and offset of 0.

Expected behavior
I would expect that the API returns the track object with the limit and offset set to what is passed in through the parameter. I tried other functions with similar options object and it seems to work as expected. I am assuming there is some extra logic that needs to be added so that the limit and offset values are applied to the tracks belonging to the playlist rather than the actual playlist query (i.e. returning at most 12 playlist matches with an offset of 5).

Desktop (please complete the following information):

  • OS: [Mac OS 10.15.2]
  • Browser [chrome]

P.S. This is a great project and, unless there is already a solution to this or I am doing it wrong, I would be happy to take a deeper dive and contribute some solution!

Hi @eduardoRubioG! The signature for the function changed to only receive the playlist id, as Spotify drop the user_id bit from the request. Could you try again and reopen the issue if it's still failing?