beetbox / pyacoustid

Python bindings for Chromaprint acoustic fingerprinting and the Acoustid Web service
MIT License
332 stars 66 forks source link

Feature: Join artist names by join phrase #74

Closed y-young closed 1 year ago

y-young commented 1 year ago

There's a join phrase option for artist names, we can utilize it to reproduce the same artist credits as on MusicBrainz page.

y-young commented 1 year ago

I have one general question that has to do with how thoroughly you've tested this against the live API: do you know if there are always joinphrases provided when there are multiple artists, or can these be missing sometimes? If they can sometimes be missing, it seems like we may want to use a default other than "" to join artists (for the non-last artist). Otherwise, they will get strung together like FooBarBaz when a join phrase is not provided.

AcoustID gets recording metadata from MusicBrainz, MusicBrainz always stores a join phrase, the default is '':

https://github.com/acoustid/mbdata/blob/ea0e7e2af55096b221b54f3c1e59154f9c03583b/mbdata/sql/CreateTables.sql#L404

When editing on the web page, the editor will automatically fill in join phrases like , and &, but there're cases where two artists are joined with empty join phrase, such as a group name consists of parts from the two artist names, so we can't always replace '' with '&'.

The reason we need the default option here is that MusicBrainz web service omits empty join phrases in response, e.g. a single artist name, or the last artist name in a list of multiple artists:

https://github.com/metabrainz/musicbrainz-server/blob/659e29bb1a328deae2955a509a6c2fb21bd144ca/lib/MusicBrainz/Server/WebService/XMLSerializer.pm#L219