Get User's Saved Tracks wrong order in specific cases

Reply

Get User's Saved Tracks wrong order in specific cases

danduh
Casual Listener

As I'm currently working with the endpoint Get Current User's Saved Tracks I've noticed a peculiar issue. Tracks in the JSON response are in the wrong order in relation to the limit and offset parameters (compared to any Spotify app).

This is easily reproducible, at least on my account.

The issue appears when multiple/all tracks of an album are saved. So either through Like all songs in the mobile app, or selecting all tracks (Ctrl+A) and saving them in the Desktop/Web app.

 

Requesting the above mentioned endpoint returns tracks in reverse 'Date added' order, except when 'cutting off' an album. In this case the tracks of the album are not only not correctly ordered, but seem to be picked randomly from the selection of saved tracks of the album.

 

Here's an example with example data:

  • saved_pos: position in actual saved tracks UI (ordered by Date added)
  • album_pos: position of track in album, not shown for single tracks in this example
  • track_name: name of the track

Note: the songs from the album were saved all at the same time i.e. added_at is the same timestamp

saved_posalbum_postrack_name
1-Your Power
2-Heartbreak Anniversary
3-deja vu
41thousand eyes
52home with you
63sad day
74holy terrain
85mary magdalene
96fallen alien
107mirrored heart
118daybed
129cellophane
13-We're Good
14-Arcade
15-Streets

 

Sending a request to the API (https://api.spotify.com/v1/me/tracks) with parameters limit=15 offset=0 returns exactly the order as above.

 

Sending another request with limit=9 offset=0 returns:

 

saved_posalbum_postrack_name
1-Your Power
2-Heartbreak Anniversary
3-Levitating
46fallen alien
58daybed
61thousand eyes
79cellophane
87mirrored heart
94holy terrain

 

Evidently, tracks are both in the wrong order and a different selection. The same phenomenon appears 'from the other side' so when using the parameters limit=10 offset=7. It also happens when using limit=50 (the maximum), anywhere in the saved tracks library, as long as it partially intersects a saved album.

0 Replies
SUGGESTED POSTS