-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
When filtering the label to remove segments, the regex matches the first hyphen it finds, possibly removing parts of the title.
For example, if listening to "Trans-Europa Express - 2009 Remaster" (Kraftwerk) with "remaster" filtered out, the first hyphen matches and the track is displayed as "Trans".
A possible fix (that I haven’t tested) is to replace the first .*
in this line of label.js
const filterRegex = new RegExp("(?:-|\\(|\\[).*(?:" + sanitizedInput.replace(",","|") + ").*(?:$|\\)|\\])","gi");
with
[^-\\(\\[]*
that is, a run of something that doesn’t contain hyphens or opening brackets, so that we only match the last hyphen or bracket. (My regex is a bit rusty, I might have made some mistakes.)
Thanks for the extension otherwise! :)
Metadata
Metadata
Assignees
Labels
No labels