XML not returning recording queries properly

I use the XML API to retrieve information from the database. This has been working pretty solidly (timeouts excluded) for the past several years. I haven’t made any changes to my code in months, but noticed a few days ago that I wasn’t getting track information from releases for some reason. Here’s a quick example. I run a query for Childish Gambino’s new album and get a list of REID’s the first of which is “d65b6db8-2ed9-409a-8d19-af8e6953e6a6”. I want to run a query to get all the recordings on that release so I hit this end point:

http://musicbrainz.org/ws/2/recording/?query=reid:d65b6db8-2ed9-409a-8d19-af8e6953e6a6

which returns:

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0" created="2016-11-09T23:43:24.411Z">
    <recording-list count="0" offset="0"/>
</metadata>

Which is clearly not correct. There are recordings associated with that release. What gives?

Sometimes I see this happen for all releases of an album, sometimes it’s just a few and the others work correctly. It’s definitely a new problem though.

You know the release and you want to find the recordings on that release.
You do that with the inc=recordings
Try the following to get the recordings on that release.

http://musicbrainz.org/ws/2/release/d65b6db8-2ed9-409a-8d19-af8e6953e6a6?inc=recordings

You can then make further web service to get more information for each recording in the list.

3 Likes

Right, but the query in the top post should work. It does for other releases.

2 Likes

The first query is a search, handled by a separate backend. It’s not unimaginable that there is a technical issue with the search server; a lookup or browse request should be more reliable in any case.

4 Likes

FWIW, there’s a ticket that matches this issue, Web service search for recordings by MBID of release returns no recordings.

It was deemed a matter of “wait for the indexer to run”, but maybe it was a valid bug too?

1 Like

That’s almost two years old, though; I don’t think it can be the current issue.

So apparently I’ve been doing this wrong the whole time. Sure, it ought to work (and has for at least 5 years) but the query I was doing was stupid. All I care about with my tagger outside the specific release information is the number of discs, the songs on each disc and their lengths. Won’t need to make any further requests and I’ll have a lot less XML to parse through.

Thanks dns_server. I have to rewrite a bunch of code, but the end result is going to be a lot cleaner (and I can get rid of a bunch of weird corner cases). Thanks!

6 Likes