Re: [mb-users] Track duration is None

Ian McEwen <[email protected]> Tue, 16 Apr 2013 11:33:51 -0700
Newsgroups gmane.comp.audio.musicbrainz.user
Message-ID <[email protected]>
Okay, so, first of all, python-musicbrainz2 is deprecated, since the webservice version it uses (/ws/1) is deprecated. So I'd suggest moving away from that. However:

https://musicbrainz.org/ws/1/release/?discid=Uet7Ne0jNNwhz206YC0rPlDJELw- is the url it constructs initially. You can see the result it found.

Issue: that endpoint includes CDStubs[1] by default. As you can see, https://musicbrainz.org/ws/1/release/?discid=Uet7Ne0jNNwhz206YC0rPlDJELw-&cdstubs=no does not include that result. Also, CDStubs don't support many of the various ?inc parameters, and they don't have much info.

The CDStub is: https://musicbrainz.org/cdstub/Uet7Ne0jNNwhz206YC0rPlDJELw-

I'm not sure why it's not including durations, but I'd bet it's because it's a CDStub.

In general, I'd recommend a.) moving away from python-musicbrainz2 and /ws/1, b.) if you must, figure out the proper way to exclude CDStubs, and c.) sometimes things just don't have durations even after all that. So you'll just have to account for that somewhere :)

Hopefully this helps.

[1]: http://wiki.musicbrainz.org/CD_Stub

On Tue, Apr 16, 2013 at 11:32:16AM -0600, Jeffrey Barish wrote:
> When I look up the track duration for a particular recording using the API
> thusly:
>
> rel_filter = mbws.ReleaseFilter(discId='Uet7Ne0jNNwhz206YC0rPlDJELw-')
> result = query.getReleases(rel_filter)
> release = result[0].release
> release.tracks[0].title
> u'Adagio \u2013 Allegro molto'
> print release.tracks[0].duration
>
> I get None.
>
> I figured that I should check the duration using the web interface, but I
> cannot find the recording.  It must be in the database -- right? -- because I
> get a result when I search using the API.  Is there a way to look up a
> recording using the disc ID?  How does it happen that the duration of the
> tracks on this recording are all None?  Is this record erroneous, or do I have
> to protect against this value?
>
> Jeffrey Barish
>
> _______________________________________________
> MusicBrainz-users mailing list
> [email protected]
> http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-users

--
Ian McEwen <[email protected]> <[email protected]>
A262 D5C4 40CB 0E1C 5F24 C3A1 ABED 1ABD 7131 A76F
http://ianmcorvidae.net/

_______________________________________________
MusicBrainz-users mailing list
[email protected]
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-users
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iEYEARECAAYFAlFtmY8ACgkQq+0avXExp29STwCbBt3hgZoLN9cMfz8IzRL1J4El
QIcAoIkNwhw8gyhFn3wW3kk4FIF07Td6
=7oUK
-----END PGP SIGNATURE-----