As per request of a friend, I want to develop a Picard plug-in with several features, but the first feature I would like to implement is getting the artist’s country (on a per track basis) implemented as a metadata tag. This is to have the country’s flag show up in the foobar2000 theme Georgia, right next to the artist’s name.
While I got a proof of concept working, it has two major issues preventing me from releasing it publicly for proper use:
- Due to the rate limitations of MusicBrainz’s API, the current implementation gives an error after about 12 tracks are labelled with the artist’s country (503 error). The code is currently per track basis, while I would prefer to have it done per album basis to save API calls by using a cache.
- I used an own implementation to get metadata from the API (using Python’s native
urllibmodules), instead of the album webservices tagger, due to its workings not being clear to me from looking at documentation and some plugins in the repository.
Could anyone point me to the right direction how to use the webservices class within the
Picard module to obtain the artist’s country (from the
area field) and how it could be handled per album iterating through tracks? Or set up a rate limit that would prevent the API giving a 503 error?
To make it clear, I’m already aware of which metadata of the API I should be looking at (artist ID and the
area to determine the country’s name). I’m asking questions how to use the Picard module properly with MusicBrainz query’s to not have to rely on my own implementation with the Python modules, and how to have the code run as an album action which is capable of iterating through tracks. I’m aware that the album actions can edit general album metadata, but is it possible to do what I want per album and have its tracks all separately adjusted (in case there are differing artists), instead of relying on a per track action (which causes the API to 503 on me due to the rate limits).