Double length values with API lookup query

Tags: #<Tag:0x00007f756b093070>

Hi all,

I am doing a lookup query on a release using the release-id like the following:-

https://musicbrainz.org/ws/2/release/release-id?inc=artists+recordings+release-groups+artist-credits+genres+tags+media

The JSON reply gives the object “media” which has 2 lengths as:-

media > tracks > length
media > tracks > recording > length

The difference in value between these two lengths can vary considerably. Can anyone explain why there are 2 values, and what their relationship is?

Thanks in advance

The track length is the length of the track as it appears on the release. This is what you can set when you edit the tracklist or a release on MusicBrainz.

The recording linked to a track does not have an editable length, instead it uses an average of the track lengths of all tracks linked to it. Not entirely sure right now how the average gets calculated, but I think it’s the median.

2 Likes

Thanks for your reply @outsidecontext.

I’m not interested in the average (or median) value - I’ll stick to the release length.