Get tracklist of album with MusicBrainz ID

909 Views Asked by At

I'm currently using the mikealmond/MusicBrainz class to get the info I need from the wonderful MusicBrainz database.

But I have one problem, I need to get recordings off a release, I've found how to do it on the web API here in the browser via this url: musicbrainz(dot)org/ws/2/release/61bf0388-b8a9-48f4-81d1-7eb02706dfb0?inc=recordings

But in the class I'm using they require that I add a entity before I add the ID of the release, but I don't know what to add. And if I try to take it away I just end up with a url like this: musicbrainz(dot)org/ws/2/release/?=61bf0388-b8a9-48f4-81d1-7eb02706dfb0?inc=recordings and that doesn't work. Is there a entity I can add to say that I'm giving the release mbid?

Or maybe someone could help me change the class I'm using to make this work, I've tried doing it myself but failed.

EDIT: I've tried to contact the author with no luck.

I've tried this code from the class mentioned above:

$includes = array('recordings');
try {
    $details = $brainz->browseRelease('61bf0388-b8a9-48f4-81d1-7eb02706dfb0', $includes, 2);
    print_r($details);
} catch (Exception $e) {
    print $e->getMessage();
}
print "\n\n";
1

There are 1 best solutions below

0
On BEST ANSWER

I am the author of the library. I just answered this question on GitHub but thought I'd share the answer here as well.

What you are looking to do is a Lookup.

$details = $brainz->lookup('release', '61bf0388-b8a9-48f4-81d1-7eb02706dfb0', array('recordings'));

Another way to do this is to browse the recordings based on the release.

$details = $brainz->browseRecording('release', 'aad08360-f5cd-4e3b-9df6-88dae1b3e3f2', $includes, 2);