As I mentioned a few days ago, I’m rebasing a project on python-musicbrainzngs. In the old code, I would do one API call per track. As I dug into the API, it was looking like I could get away with a lot less. In fact, for a long time, it would looking like I could get all the metadata I wanted to tag an entire release with just a single API call. Then I hit a snag. I decided to add a new feature to the code: look for primary artist aliases for a given locale. No more translating from Cyrillic to Latin by hand. I would need this for release ACs, track ACs, recording ARs, and work ARs. After playing around with the includes, I wound up with this:
incs = ['artists', 'artist-credits', 'artist-rels', 'recordings', 'recording-level-rels', 'work-rels', 'work-level-rels', 'release-groups', 'labels', 'aliases'] releaseid = '0aadac63-79e4-4374-8757-a36f887a8121' result = musicbrainzngs.get_release_by_id(releaseid, includes=incs)
Which got me aliases for everything but the work ARs - those dang Russian composers! So, I fell back to one API call per work. Most recordings have only one work, so it wouldn’t be much worse than where I started. That led me to this:
incs = ['artist-rels', 'work-rels', 'aliases'] workid = '36dfecf2-b58c-3997-a629-3b34979791ae' result = musicbrainzngs.get_work_by_id(workid, includes=incs)['work']
I was very surprised to find this still didn’t give me the aliases for the artists in the artist-relation-list. Calling the API for each work-artist AR is a deal breaker. Is there something I’m doing wrong? I haven’t had to make a per-artist API call for any of the other artist relations.