-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create re-convert_guillemets.py #240
base: 2.0
Are you sure you want to change the base?
Conversation
[re-]change metadata: change "<<" and ">>" to '«' and '»' (guillemets). Workaround for my problem with replaced guillemets, see Issue metabrainz#238
plugins/re-convert/re-convert.py
Outdated
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
|
||
PLUGIN_NAME = "re-convert" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This title is too generic. It needs to be called something like "Convert guillemots" in order to explain to users what it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to limit it to guillemots only. Maybe there will be more characters in future.
But maybe it's not worth to publish it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better for it to do something simple - and be well named.
…ert_guillemets/re-convert_guillemets.py
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:
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. |
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. |
Yes, something more generic would be better, I'd prefer a script function. |
[re-]change metadata: change "<<" and ">>" to '«' and '»' (guillemets).
Workaround for my problem with replaced guillemets, see Issue #238