Announcements

Help Wizard

Step 1

NEXT STEP

API is returning inaccurate artist release totals

API is returning inaccurate artist release totals

Hi! I've been working with the spotify.py repository for a few months, and have encountered a number of issues recently, all stemming from one bug; API calls are not returning accurate release totals for every artist. Some artists are fine, but others are not. This has most notably caused me headache with iterable album parsing, as it wasn't reaching the number of albums expected and, as a result, wasn't breaking the iterable. This data point is fairly essential to my functions, as the artists' total release counters are what tell the script which artists have unparsed releases. This should be the most efficient implementation, saving spotify API bandwidth and myself from rate limits. 


For those wondering, I'll give a technical explanation of how I found this. When running API requests through the artist albums endpoint, one data item returned from the request is an integer, "total", which represents the number of releases from the artist. When iterating all albums from an artist, spotify.py checks the number of album objects returned against the integer "total" to gauge how many albums it should expect. These numbers should match up when the function is finished, but they don't. This is causing cascading issues in my code, wherein it relies on the integer "total" to be accurate. 

 

Is there a known cause or fix for this? Thanks!

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random