Singleton disambiguation

Looking at the Path format docs, I see that I have access to albumtype (useful for differentiating concert bootlegs from studio albums, for example), as well as the %aunique{} function and albumdisambig value. There doesn’t seem to be anything comparable for singletons, though.

The problem I’m trying to solve is the case where an artist plays one particular song at many concerts, and I like the song enough to collect many live versions of it and compare the variations from one performance to another without having the whole concert setlist in my collection as an ‘album’. Under my current setup, if I just keep hitting Keep both, I end up with Cornflake Girl.1.mp3 through Cornflake Girl.17.mp3, for example, which is not ideal. As far as I can tell, using the Musicbrainz disambiguation comment (as described here) to generate filenames like Cornflake Girl live 1996-06-08, Milwaukee, Wisconsin, USA.mp3 seems like the most elegant way to achieve this.

So the question is, what’s the least painful way to get there from here? I assume Path formats don’t have undocumented access to pull arbitrary fields out of the raw musicbrainzngs dict object… do they? Assuming that’s a no, how about a snippet for the Inline plugin? From there, can I pull the disambiguation field from the musicbrainz entry that beets has already retrieved for the current item during import? And if so, would something like the following be enough to do it?

item_fields:
    disambig: disambiguation

…and then just refer to $disambig in my singleton: Path format (which would presumably not add anything if the disambiguation field is not set)?

I feel like that looks way too easy and I must be missing something. Am I missing something?

Also, should I open a Github issue for adding the item disambiguation field to the built-in list of Path values? This strikes me as a thing that might be useful for a fair number of people, and probably a relatively painless change to implement.

Sadly no; we don’t keep the full MusicBrainz API response (which can be quite complex and nested). An inline incantation also can’t work around this.

We do currently fetch the disambiguation string for MB works (work_disambig), but I don’t think that’s what you’re after here. We will need to separately fetch the track disambiguation, as mentioned here:

It shouldn’t be too hard, but it will take some effort. Please feel free to jump in if you feel you have the skills!