![]() For example, go to David Bowie, and in the "Artist Information" panel on the right side, you'll see "Sort name: Bowie, David". Each artist has a name and a sort name, in the database, entered by a human user and verified by other users. There are very few automatic defaults in MusicBrainz. I am trying to write a plugin for MusicBrainz that matches the albumartistsort to albumartist and artistsort to artist, as opposed to the (apparently) default of Last Name, First Name format it is currently using. Your code, at least as posted here.īut let's go through your questions one by one: ![]() And so on.Īlso, your code has to be valid Python, with valid indentation. If you want to use re.search, you use regular expression syntax. ![]() If you want to check whether things are equal, you use the = operator. In particular: match = re.search($not($eq(metadata,metadata))) You can't mix and match syntax between the two languages. Tagger scripts are written in a simple custom language plugins are written in Python. I think your biggest problem is that you're mixing up the plugin API with the tagger scripting language. If there's a more thorough documentation for it, you can pinpoint what I am doing wrong in my code, or know how to include the picard module in an interpreter (where to find it AND how to include it), then your comments are very much appreciated and valid answers to this question. the search and match methods they use in different plugins with re are not explained in the documentation links I am referring to. I believe the plugin documentation here, here and here is not enough to follow the plugins they have there (e.g. I must point out that I don't fully understand when these are called. Register_album_metadata_processor(copy_artist_to_artistsort)Īnd I also tried defining the functions as: def copy_albumartist_to_albumartistsort(tagger, metadata, release): Register_album_metadata_processor(copy_albumartist_to_albumartistsort) Metadata = metadataĭef copy_artist_to_artistsort(tagger, metadata, release): Match = re.search($not($eq(metadata,metadata))) PLUGIN_API_VERSIONS = įrom tadata import register_album_metadata_processorĭef copy_albumartist_to_albumartistsort(tagger, metadata, release): PLUGIN_DESCRIPTION = "Sorts artist/album artist by name as in Artist/Album Artist field instead of Last, First" This is the code I have: PLUGIN_NAME = "Sort Artist and Album Artist" I am guessing this is due to a compilation error, but I haven't been able to include whatever I need so I can use the picard module (don't know where to find it nor import it) so I can test in my python interpreter. When I try installing the plug in, it doesn't appear in the plugin list although it is copied to the plugin folder and the. ![]() I am just learning about Python and therefore I am trying to use another plugin as a guide, but some important changes need to be done and that's where I probably screwed up. As an exercise for learning, I am trying to write a plugin for MusicBrainz that matches the albumartistsort to albumartist and artistsort to artist, as opposed to the (apparently) default of Last Name, First Name format it is currently using. ![]()
0 Comments
Leave a Reply. |