Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

duration_ms includes nonsense JSON

duration_ms includes nonsense JSON

Selbi_0-1702803563024.png

 

For a few days now, my app has been broken. After some digging it appears my code tries to cast the duration_ms field to an integer, but appears that field now also includes some weird "totalMilliseconds" JSON, causing the entire parser to fail. Why was this added? This just causes issues.

 

EDIT: On further testing, this only seems to be the case for local files.

Reply
5 Replies

I'm not seeing this in my track object responses.

Try fetching a playlist that contains Local songs.

Not sure I have any of those, but that's a useful detail about your problem.

I can confirm the duration_ms field's value does not match the specification for local files as described by Selbi. I'd like to kindly request Spotify's advice on whether the documentation or the actual behavior is to be considered correct 🙏

This appears to be fixed, duration_ms now returns a # rather than a sub-field totalMilliseconds.

 

I created a PR #413 in the spotify-web-api-java library. (can't post gh links?)

Suggested posts