Replies: 2 comments 1 reply
-
Try: country_name: |
import pycountry_convert
artist_country = item['artist_country']
country_name = pycountry_convert.country_alpha2_to_country_name(artist_country)
return country_name |
Beta Was this translation helpful? Give feedback.
-
I added some debug code to print all the available globals with
but Also looking at the documentation it looks like the custom fields are only available in path definitions and not in other plugins? Then what I want is indeed not possible using the inline plugin, which is unfortunate. Maybe I will try to write my own plugin that adds |
Beta Was this translation helpful? Give feedback.
-
I am trying to use custom fields provided by another plugin with the inline plugin, but it does not seem to work. The standard fields are available in python but custom fields provided by other plugins give a python NameError.
Context: I use the beets-artistcountry plugin to get the country of the artist. It is available in the
$artist_country
variable and I can use it in mypaths
definition, like this, and it works:But I want to get one step deeper and retrieve the country name, and the continent for that artist_coutry. I am able to do that using the inline plugin and a python snippet. I got it working for the default
country
field but that is the country of release, not the artist country. So I want to do the same withartist_country
.However,
artist_country
seems not to be accessible in python using the inline plugin. I get aNameError: name 'artist_country' is not defined
error.Relevant parts from my config:
Error output when I do an import is:
Beta Was this translation helpful? Give feedback.
All reactions