nleroy917 / spottydata-api

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

Playlists With Less Than 50 Tracks Can't Be Analyzed #20

Closed nleroy917 closed 4 years ago

nleroy917 commented 4 years ago

When trying to analyze a playlist that has less than 50 tracks, the code that parses the artist id's doesn't format the query parameters right for the Spotify API call and then it returns a 400 response of "invalid id". This is because I was assuming that all playlists would be >= 50 tracks.

I added a check for playlists less than 50 tracks long, but I should probably make it more generalizable.

The reason this was an issue in the first place is that getting tracks returns 100 tracks, while getting artists only returns 50.. so I need to split the call up into two calls and merge the data at the end.

Anyways, bug fixed for now.

nleroy917 commented 4 years ago

Oops. Forgot to close this. Fixd with commit 90a898ed6d8e93342f1c49fffb511553ae741572