PICARD-1044: Allow the usage of scripting for loading local cover art#3042
PICARD-1044: Allow the usage of scripting for loading local cover art#3042zas wants to merge 1 commit intometabrainz:masterfrom
Conversation
- add a checkbox to select the mode (regex or script) - add a script editor widget, along error/example - provide evalutation time methods accordingly
phw
left a comment
There was a problem hiding this comment.
Generally code looks fine and this seems to work.
I just wonder how useful this is, as it only works with exact matches. I initially thought we might be able to allow scripting but still have regex matching.
But this will become difficult, as it would be extremely tricky to have the script return a valid regex. We could escape all variables beforehand, but this then makes the variables difficult to use.
But could we have the resulting filename allow glob matching? So users could have * or ? returned as part of the filename for partial matches. It could be an option.
Also we could allow matching the file name case insensitive.
|
Not sure what is the exact use case for this, maybe ask to the 2 people asking for it in the ticket. |
|
A bit of thinking out loud here, but rather than using EDIT: There could even be a text box or label showing the regular expression created so the user could check that it made sense for them? EDIT 2: For example, if the user entered something like: would yield the regular expression: EDIT 3: Might need a new scripting function like would yield the regular expression: |
|
Just thinking that this might even allow the users to set track-specific cover art. Not something that I would want to do, but I've seen some users ask about this. |
Actually, that could already be accomplished using the |
Summary
Problem
The dialog for saving cover art supports the use of scripting, but the dialog for loading local cover art does not (it only supports regex). It would be very helpful if you could use the scripting there as well, so you could search for a more specific filename, such as "Cover\Album Artist - Album [Date].ext".
Solution
AI Usage
In accordance with the AI use policy portion of the MetaBrainz Contribution Guidelines, the level of AI/LLM use in the development of this Pull Request is:
Action
Additional actions required: