1 (edited by markhoney 2012-06-20 11:41:39)

Topic: [solved] unset ID3 field

In Picard 1.0 I don't seem to be able to unset any ID3 fields from my File Naming script (e.g. $unset(%name0%) ) - has something changed?

Ideally, I'd like to be able to set tags from within a plugin I've written that would be available to the naming script but not written to the ID3 tag. As this wasn't previously possible with Picard I ended up setting some fields from within my plugin, using them for file naming and then unsetting them before the tag was written. This doesn't work now, and I end up with fields that I don't want in my ID3 tags.

Does anyone know of another way I could achieve this?

Re: [solved] unset ID3 field

$unset(%name0%) has never worked. It would be $unset(name0).

It would be highly unusual to do this in the file naming script (and not sure it would work properly?); that would be something you'd do in the tagger script under advanced > scripting.

If you don't want fields in your tags, you should do $unset(name0) in tagger script. If you don't want it in tags, but you do want it available to file naming, you should do

$copy(specialtag,name0)
$unset(name0)

where name0 is one of the standard Picard tags - then use %specialtag% in the file naming script.

I don't see why writing plugin code would be required, but without being specific about exactly what you're trying to do, it's impossible to tell. Maybe you should be more specific about the scripts/plugin that did work before, which you think doesn't work now.

Re: [solved] unset ID3 field

Hah, sounds like I was using the wrong syntax then. My plugin does a lot of subdirectory naming, etc for each album based on lots of factors such as type, name, artist, etc, and so it's easiest to do this in Python and pass the resulting directory names to the naming script. I'll try without the %s and see if it works. Thanks!

Re: [solved] unset ID3 field

You can set variables in plugins prefixed with a tilde, they will be available to Picard for file naming prefixed with an underscore and won't be written to your files. For example, if you set metadata["~foo"], you will be able to use %_foo% and it won't be written to your files.

Have a look at the plugin just posted in http://forums.musicbrainz.org/viewtopic.php?pid=18927 for a real example.

Re: [solved] unset ID3 field

Ahh yes, quite right nikki - forgot to mention you can do it that way. The "specialtag" way I mentioned above works fine for MP3 but is not a good strategy for formats like VORBIS which free-form fields are accepted; if using tagger script (for someone else who reads this thread) using _specialtag would be a better approach.

Re: [solved] unset ID3 field

Great nikki, that's exactly what I'm after - the tilde is perfect for my needs. thanks!

Re: [solved] unset ID3 field

Actually, looking at that plugin and the Picard documentation, I can see that it's using request_artist which I can't find documented anywhere. I also haven't come across the tilde documented - am I looking in the wrong place, or is there no up-to-date documentation for writing Picard plugins?

On a related note - now that Release Groups have a primary and (multiple) secondary Release Types, how do I get to the Secondary types from a plugin? They don't seem to be written to the ID3 tags.

Re: [solved] unset ID3 field

request_artist is the name of the function reference registered as a metadata processor - nothing that would be documented?

In any case, there's no good plugin-writing documentation. There's http://musicbrainz.org/doc/MusicBrainz_ … lugins/API and the reference to the tags available within the metadata at http://musicbrainz.org/doc/MusicBrainz_Picard/Tags - other than that, debug and see what's available, Python-style :D

Picard has not been updated to handle secondary releases types so the data is not available in the metadata object for plugins or tagger scripts. Probably in the next release. If you could add your thoughts on what would be best to expose at http://tickets.musicbrainz.org/browse/PICARD-240 that'd be useful.