marie
marie

Reputation: 417

Return track-list using musicbrainzngs.search_releases()

I'm getting acquainted with musicbrainzngs and have run into a snag. All of the track-lists which are returned from the following are empty. Are there additional parameters I need to provide or is this a bug?

releases = musicbrainzngs.search_releases(
            query='arid:' + musicbrainz_arid
        )

Upvotes: 2

Views: 564

Answers (1)

JonnyJD
JonnyJD

Reputation: 2643

This is expected. You have three ways of retrieving data from the MusicBrainz web service (using musicbrainzngs or directly):

  1. lookup/get info for one entity by id: lots of info for that id
  2. browse a list of entities: possibility to get long list, medium amount of information
  3. search for entities: powerful to find things, but not much data given

When you know an entity by id you can look it up directly. You can even add includes to get very detailed information.

When you not only want one entity, but a list (like a list of releases for one artist) you can browse. Even for these you can add includes.

And only when you don't know the id of the entity (or an attached entity) or if you want to cut down the list of entities you search.

In your case you know the artist id and want to get the list of releases. In that case you should use browse_releases and set an include for recordings:

releases = musicbrainzngs.browse_releases(artist=musicbrainz_arid,
                                          inc=["recordings"])

Upvotes: 1

Related Questions