python-musicbrainzngs icon indicating copy to clipboard operation
python-musicbrainzngs copied to clipboard

browse_recordings: not able to force additional information using includes-argument

Open inkrement opened this issue 9 years ago • 3 comments

musicbrainzngs.browse_recordings(artist=None, release=None, includes=[], limit=None, offset=None)

Neither release-rels nor release-group-rels as part of the includes argument has effects on the output. Each recording entry provides only title and id-attributes:

{'recording-count': 663, 'recording-list': [
{'title': 'All or Nothing (single version)', 'id': '02f13340-237a-494b-9501-c2a7f8ec0258', 'length': '206333'}, 
{'title': 'Balls to the Wall', 'id': '047877c8-297f-4269-83c4-e3ca598ea952', 'length': '494000'}, 
{'title': 'Balls to the Wall', 'id': '05097e17-6ed4-47d0-a837-558735e07675', 'length': '343213'}, ...

Full log:

import musicbrainzngs as m m.set_useragent("github issue demo", "0.1", "<>") m.browse_recordings(artist='7364dea6-ca9a-48e3-be01-b44ad0d19897', includes=['release-rels', 'release-group-rels'], limit=10, offset=0) {'recording-list': [{'length': '250613', 'id': '038ba753-a6ce-4bc4-ac57-de3e31ccf56f', 'title': 'A Fine Blue Line'}, {'length': '249000', 'id': '0cea66f6-a888-4c8d-9090-4c7a309f8a01', 'title': 'A Fine Blue Line'}, {'length': '185000', 'id': '9206716a-a7ed-4823-8662-04b7435c6581', 'title': 'All the Planes That Come in on the Quiet'}, {'length': '247000', 'id': '970245dc-1c73-45bb-99f5-fddf998f2628', 'title': '#9 Dream'}, {'length': '251573', 'id': '9965e476-eec2-4432-9db3-ee652b304418', 'title': 'A Little Bit'}, {'length': '247866', 'id': 'a619c619-3a67-4f21-8fa8-b4b8a63328c1', 'title': 'A King of Christmas Card'}, {'length': '175026', 'id': 'a6d73b02-8c56-4f60-bbb1-2275cea3f44d', 'title': '(Seemingly) Nonstop July (LP version)'}, {'length': '272213', 'id': 'd795a746-ef7b-44fd-b055-0300167601a5', 'title': 'Afternoon High'}, {'length': '279960', 'id': 'e4650e10-a478-40f4-b98a-9deb8a9d3212', 'title': 'Afternoon High (original demo version)'}, {'length': '184826', 'id': 'f9c0ed8e-9e63-42f5-955f-595ecae6116b', 'title': 'All the Planes That Come in on the Quiet'}], 'recording-count': 1101}

inkrement avatar Feb 03 '16 10:02 inkrement

It looks like musicbrainz doesn't return this information:

http://musicbrainz.org/ws/2/recording/?artist=7364dea6-ca9a-48e3-be01-b44ad0d19897&inc=release-rels+release-group-rels

I'm confirming the issue with them now. In the case that it's not supported we should probably prevent these includes from being used.

alastair avatar Feb 03 '16 11:02 alastair

I would only disallow the includes if the server doesn't allow them (or deprecates them as "not intended").

JonnyJD avatar Feb 04 '16 20:02 JonnyJD

None of the recordings in the response posted have any release or release-group relationships, so there's no bug that I can see, except maybe clarifying the documentation.

Check out https://musicbrainz.org/ws/2/recording/?artist=32bad879-c2fa-4da3-b06a-ac1fcd380c55&inc=release-rels&limit=100&offset=100&fmt=json and you can see a "samples material" release relationship for the recording "Wolf Rotorvator" is included, so the inc params definitely work.

About release-group-rels, currently no recording-release_group relationship types exist: https://musicbrainz.org/relationships/recording-release_group

But I don't think it makes sense to disallow inc=release-group-rels, for instance, because we might add a recording-release_group relationship type in the future, and it would break existing code that expects a generic way to get every relationship.

I guess what I would do is link to https://musicbrainz.org/relationships in the documentation and explain that the inc parameters only have an effect where relationship types (and relationships) actually exist.

mwiencek avatar Feb 05 '16 18:02 mwiencek