[Case Checker] CaseChecker ignoring "littleWordString"

Get help for different MediaMonkey 5 Addons.

Moderators: jiri, drakinite, Addon Administrators

the_who
Posts: 2
Joined: Mon May 24, 2021 4:38 am

[Case Checker] CaseChecker ignoring "littleWordString"

Post by the_who »

Hi, I am delighted to see that my beloved music managing software is not just continuously maintained but has just been released in a brand new version.

I am still trying to figure out some things to make some things work like they used to work in MM4. I can't accomodate with the CaseChecker, however. I want words like "of", "a", "to" etc. to be written in lowercase. I know that the MM4-vbs-script included a variable "littleWordString" to this purpose. The same thing is present in the MM5-js-script (dglCaseChecker.js in MediaMonkey 5\Scripts\caseChecker\dialogs), yet these settings to not seem to come into effect.

I think I now figured out what the problem is. Apparently (?) Javascript treats RegularExpressions a little bit different like some other languages, in paricular when it comes to locating whitespaces. Line 46 in the code reads

Code: Select all

var whiteSpace = new RegExp("^[\s,&]+$");
Add another blackslash in front of the "s" like you see here in JS-references online, changing it to:

Code: Select all

var whiteSpace = new RegExp("^[\\s,&]+$");
Then the script seems to do what it did in MM4. However, I am absolutely no expert when it comes to Regular Expressions (actually, I prefer to run away whenever I see one). So could somebody confirm that this indeed is responsible for the JS and the VBS results diverging, and this being the proper fix?

Anyway, I'd love to see this fixed properly in a future update.
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: CaseChecker ignoring "littleWordString"

Post by Lowlander »

I was actually so happy it didn't do this anymore.
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: CaseChecker ignoring "littleWordString"

Post by drakinite »

You're right; that's actually an error. In JS, backslash is an escape character; so if you just write "\s", it'll be interpreted as just "s". So the regex on line 46 is interpreted as:

Code: Select all

"^[s,&]+$"
There's also another improperly escaped character for the cardinal regex.

To be fixed as: https://www.ventismedia.com/mantis/view.php?id=17915

(And LL; Maybe at some point we can add settings to enable/disable each of the regexes.)
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
the_who
Posts: 2
Joined: Mon May 24, 2021 4:38 am

Re: CaseChecker ignoring "littleWordString"

Post by the_who »

Great, thanks for cross-checking and fixing!
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: CaseChecker ignoring "littleWordString"

Post by drakinite »

Np; thanks for letting us know :slight_smile:
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
MarcLister
Posts: 28
Joined: Wed Aug 05, 2020 8:34 am

[Case Checker] Configure Case Checker?

Post by MarcLister »

I have a number of tracks that say "PT" for Part instead of "Pt" as I'd like. With MM4 and the 'Case and Leading Zero Checker' add-on I could add/remove forced upper/lower case words. So in MM4 I could add "Pt" to the list and get all my songs with "PT" updated. I don't see how to do this with the built-in plugin for MM5. It appears to be automatic and doesn't allow me to configure settings to suit my preferences.

Is there something I am missing? I have checked in the Add-ons library of MM5 and no configurable add-ons are showing so I assume that there is no option to configure the add-on to my preferences.
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: [Case Checker] Configure Case Checker?

Post by Lowlander »

It wasn't configurable in MediaMonkey 4 either, perhaps you edited the Script file directly which still can be done by editing caseChecker\dialogs\dlgCaseChecker.js in the Scripts folder where MediaMonkey is installed.
MarcLister
Posts: 28
Joined: Wed Aug 05, 2020 8:34 am

Re: [Case Checker] Configure Case Checker?

Post by MarcLister »

Lowlander wrote: Sat Jun 05, 2021 9:02 am It wasn't configurable in MediaMonkey 4 either, perhaps you edited the Script file directly which still can be done by editing caseChecker\dialogs\dlgCaseChecker.js in the Scripts folder where MediaMonkey is installed.
In MM4 I used a third party checker, not the built-in one. Does the MM5 one allow for configuring within the program or would the person who created the MM5 add-on have to update it for MM5 for this to be workable?

OK, I have found the file. Interestingly 'Pt' is set yet CaseChecker doesn't pick up PT in the affected tracks. Could this be because it isn't 'PT' on its own but 'PT1' or 'PT01' etc? And so I'd need to add PT1, PT2, PT01, PT02 to the list for MM to match against these?
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: [Case Checker] CaseChecker ignoring "littleWordString"

Post by Lowlander »

Yes, it needs to be on its own.
Post Reply