Add To Library API adds tracks in random order

Originator:darren.mo
Number:rdar://FB13471315 Date Originated:2023-12-15
Status:Open Resolved:
Product:MusicKit Product Version:Web
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
I have attached a sample project demonstrating a batch Add To Library request:
```
https://api.music.apple.com/v1/me/library?ids[songs]=1675379749,348906128,…
```

The tracks are added in a random order. I expected the tracks to be added in the order that I specified.

I’m not sure if there is an issue with the server endpoint but what I have found is that Apple Music only has second-level timestamp precision, which means it is very easy for batch-added tracks to have the same timestamp, causing issues with the ordering of batch-added tracks. I have worked around this by adding a one second delay in between single-item Add To Library requests.

Ideally, Apple Music would be able to respect the order I specified in the Add To Library request.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!