picard-plugins
picard-plugins copied to clipboard
Create re-convert_guillemets.py
[re-]change metadata: change "<<" and ">>" to '«' and '»' (guillemets). Workaround for my problem with replaced guillemets, see Issue #238
Code-wise this looks fine for me. But I wonder if we need another simple conversion plugin like this which operates on a limited set of fields for a very specific replacement. This basically can be done by a simple script like:
$set(album,$replace(%album%,<<,«))
$set(album,$replace(%album%,>>,»))
$set(title,$replace(%title%,<<,«))
$set(title,$replace(%title%,>>,»))
Now I get it, this is a lot of repetitive code, and once you want to do a lot of replacements on a lot of tags this gets pretty cumbersome.
But I feel having a single plugin for every possible conversion does also not scale well. We already have some plugins that IMHO are too specific, as they do some not too complex conversion for only a specific set of hard coded tags.
This plugin is totally fine as a plugin that solves your specific problem, I have myself created occasionally plugins I never shared because they are too specific and solved a specific thing I was interested in, sometimes only for tagging a few files. This is really part of the power of Picard to allow users to solve their issues. Maybe this would be better suited as an example on https://community.metabrainz.org/ for others to see how to solve issues like this?
What I would find interesting is a plugin where the user can define custom replacements and the tags they are applied to in a small UI.
Code-wise this looks fine for me. But I wonder if we need another simple conversion plugin like this which operates on a limited set of fields for a very specific replacement. This basically can be done by a simple script like: ... What I would find interesting is a plugin where the user can define custom replacements and the tags they are applied to in a small UI.
Now that Philipp has raised this I tend to agree with him - this functionality can be done by a script and a more general Replace plugin with an Options / Plugins / Replace UI page where users can defined the From / To strings and the fields to operate on would be very useful.
@zas Any opinion on this? My opinion is that a plugins with a hard coded set of replacements that does this replacement for a hard coded set of tags is useful for a specific use case. But we can fill up the plugin list with an endless amount of such plugins.
We already have replace_forbidden_symbols, non_ascii_equivalents and mayve others with a very similar functionality.
In many cases I think it would be more useful to have a script function doing these changes, instead of applying them to a hard coded list of tags. Or a plugin like this, but where you can configure the replacements and the tags on which they should be performed.
In many cases I think it would be more useful to have a script function doing these changes, instead of applying them to a hard coded list of tags. Or a plugin like this, but where you can configure the replacements and the tags on which they should be performed.
Yes, something more generic would be better, I'd prefer a script function.