metabrainz / picard-plugins

Picard plugins: use 1.0 branch for Picard < 2.0 (python 2/Qt4) and 2.0 branch for Picard >= 2.0 (python 3/Qt5)
https://picard.musicbrainz.org/plugins/
145 stars 95 forks source link

Use iso-3166-2-codes if iso-3166-1-codes is not available #377

Closed rdswift closed 6 months ago

rdswift commented 6 months ago

In reviewing the discussion at https://community.metabrainz.org/t/possibility-to-tag-by-artist-area-artist-country-of-origin/596808/19 it was discovered that sometimes the country code was returned as iso-3166-2-codes rather than iso-3166-1-codes, and these were not being processed by the plugin. This PR adds the code to process these iso-3166-2-codes if there are no iso-3166-1-codes provided by the api.