I’m considering developing a Picard plugin to allow mapping genre tags to standard values based on user-specified mapping criteria. Before I spend any time on it, I’m curious to know if anyone would find it useful to them. Personally, I try to avoid genres like the plague when it comes to tagging and organizing my music collection, but I know that it’s very important to others.
What I’m thinking of is to add a new scripting function $mapgenres()
which would take a multi-value variable such as %genres%
as an argument. The function would look up each item in the variable list to see if there is a match in the mapping list, and if found it would include the mapped item in the output. The function output would be a new multi-value variable.
For example, if %genres%
contained an item “Prog Rock” and the user had mapped this to a standard replacement “Progressive Rock”, then the output would contain the replacement “Progressive Rock” rather than the original “Prog Rock”. If there was no match found in the mapping list, then the genre would be dropped from the output.
I envision the mapping file being a simple text file easily maintained by the user. There are a couple of ways that it could be formatted, such as:
Format 1
From1 => To1
From2 => To2
...
where each mapping pair appears on a separate line.
Format 2 (my personal favorite)
To1:
- From1a
- From1b
- From1c
To2:
- From2a
...
where each mapping group starts with the desired replacement, followed by a list of all the inputs that map to that target. This allows the user to more easily map multiple inputs to a single target output.
The output would use the case specified in the mapping list, but the input test comparison would be case-insensitive, and all duplicate outputs would be removed so that the resulting list would be unique.
The mapping file could either be specified as an argument to the function, or could default to a specific file genremap.txt
in the default naming directory.
So what do you think? Is this something that anyone would find useful?