You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that when fetching Bandcamp Track information using BandcampFetch().track.getInfo(), track duration information is not returned. Setting includeRawData: true allows us to see that the duration property is not called duration_secs but rather duration, and can be found under raw.basic.duration. This duration property is not a number representing the duration in seconds but rather a string that tells how long the song is in hours, minutes, and seconds: "P00H05M19S"
Code responsible for parsing the duration from TrackInfo:
I believe there may have been a change at some point in the Bandcamp API that is causing this issue. Or possibly that some tracks return the usual duration_secs info, but other tracks return this weird duration string instead.
I have prepared a RunKit playground for you if you'd like to run some sample code that showcases this odd behavior. Also included is a workaround method that I've written to fetch the duration for the time being. https://runkit.com/bonfire/bandcamp-fetch-duration
Thank you!
The text was updated successfully, but these errors were encountered:
I've found that when fetching Bandcamp Track information using
BandcampFetch().track.getInfo()
, track duration information is not returned. SettingincludeRawData: true
allows us to see that the duration property is not calledduration_secs
but ratherduration
, and can be found underraw.basic.duration
. This duration property is not a number representing the duration in seconds but rather a string that tells how long the song is in hours, minutes, and seconds: "P00H05M19S"Code responsible for parsing the duration from TrackInfo:
bandcamp-fetch/src/lib/track/TrackInfoParser.ts
Line 78 in 7658926
bandcamp-fetch/src/lib/utils/Parse.ts
Line 89 in 7658926
I believe there may have been a change at some point in the Bandcamp API that is causing this issue. Or possibly that some tracks return the usual
duration_secs
info, but other tracks return this weirdduration
string instead.I have prepared a RunKit playground for you if you'd like to run some sample code that showcases this odd behavior. Also included is a workaround method that I've written to fetch the duration for the time being.
https://runkit.com/bonfire/bandcamp-fetch-duration
Thank you!
The text was updated successfully, but these errors were encountered: