nleroy917 / spottydata-api

Backend and Web API for spottydata.com
MIT License
7 stars 0 forks source link

Playlists selection page doesn't appear to pull all playlists #14

Closed nleroy917 closed 4 years ago

nleroy917 commented 4 years ago

The playlist selection page, upon loading, doesn't seem to pull all of a user's playlists. I suspect it is an issue with the API, so I am keeping the issue here. I might open an issue on the react application repo if I find the issue is housed there.

Behavior When authorizing with Spotify, the redirect to the playlist selection page is successful, however, not all of the user's playlists are populated into the page - as if the API or React application is neglecting some.

Expected Behavior After authorization, every playlist I follow or own or created will populate and be available for selection

nleroy917 commented 4 years ago

Another thought I had is to check the chunkPlaylist() functions in the Playlists route component of the front-end. Specifically around line 98, where I am checking for undefined playlists. Link

nleroy917 commented 4 years ago

Turns out it was an issue on both ends. The API was only requesting 20 playlists, when I should have been requesting the maximum (50). So I set the new limit to 50 on the API.

In addition, the Front-End chunkPlaytlists() function was skipping the first playlist in the return package (because I am dumb and initialized the counter as 1, not 0). Playlist selection page is now pulling all playlists.