Recently there has been quite some debate about some digital releases with a really long list of release countries added. Independent on your stand on this matter, this has shown that there are some issues with how these releases are handled by Picard. Hence the current Picard 2.3.1 release attempts to make some improvements.
Let’s take the following release as an example.
By default Picard will write a single releasecountry
tag to the files. So far Picard has been populating the tag with what the MusicBrainz server returns as the country for the release. If there are multiple release events this country field is just filled with the first one in alphabetical order (Algeria in the example). But Picard 2.3.1 offers you some options to handle it better.
Using preferred release countries
The first improvement is automatic if you have configured preferred release countries in Options > Metadata > Preferred Releases. Picard will use the first country from the preferred release countries that is also in the list of release events. So for example I have configured preferred release countries to be Europe, Germany, UK. For the above example that would mean releasecountry
gets set to Germany.
Using scripting to set a different country
Picard 2.3.1 provides a new variable %_releasecountries%
, which provides the complete list of release countries for a release. You can use this to set different values for releasecountry
.
For example the following script would set it to “[International]” if there are 10 release countries or more:
$if($gte($lenmulti(%_releasecountries%),10),$set(releasecountry,[International]))
Of course you can adjust the count and the replacement text to your liking. You can also choose to save the entire list instead of just a single country to this tag:
$setmulti(releasecountry,%_releasecountries%)
Or maybe limit this list to the first entries. The following example just uses the first 6 countries:
$setmulti(releasecountry,$slice(%_releasecountries%,0,6))
What’s missing?
Countries are currently written to the tags as their ISO 3166-1 country code, with some special values added for historical countries and things like [Europe] or [Worldwide]. These codes are not always easily recognizable, e.g. that DZ is Algeria or DE is Germany might not be obvious to you. You can of course use scripting to make this more redable, e.g. if you want to see “United Kingdom” instead of “GB” in this tag use:
$if($eq(%releasecountry%,GB),$set(releasecountry,United Kingdom))
This might work if you deal only with a couple of countries in your collection. Or you just want to handle some special cases like using “Europe” instead of “XE”, e.g. I use the following script:
$if($eq(%releasecountry%,XE),$set(releasecountry,Europe))
$if($eq(%releasecountry%,XU),$set(releasecountry,[Unknown]))
$if($eq(%releasecountry%,XW),$set(releasecountry,[Worldwide]))
$if($eq(%releasecountry%,XG),$set(releasecountry,DDR))
But I actually would like to see some helper functions for this, e.g. there could be a $countryname()
function one can use to easily convert the code into a readable name.