[Case Checker] CaseChecker ignoring "littleWordString"

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: [Case Checker] CaseChecker ignoring "littleWordString"

Re: [Case Checker] CaseChecker ignoring "littleWordString"

by Lowlander » Sat Jun 05, 2021 11:21 am

Yes, it needs to be on its own.

Re: [Case Checker] Configure Case Checker?

by MarcLister » Sat Jun 05, 2021 9:33 am

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?

Re: [Case Checker] Configure Case Checker?

by Lowlander » 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.

[Case Checker] Configure Case Checker?

by MarcLister » Sat Jun 05, 2021 8:42 am

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.

Re: CaseChecker ignoring "littleWordString"

by drakinite » Mon May 24, 2021 9:55 pm

Np; thanks for letting us know :slight_smile:

Re: CaseChecker ignoring "littleWordString"

by the_who » Mon May 24, 2021 3:44 pm

Great, thanks for cross-checking and fixing!

Re: CaseChecker ignoring "littleWordString"

by drakinite » Mon May 24, 2021 2:33 pm

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.)

Re: CaseChecker ignoring "littleWordString"

by Lowlander » Mon May 24, 2021 12:08 pm

I was actually so happy it didn't do this anymore.

[Case Checker] CaseChecker ignoring "littleWordString"

by the_who » Mon May 24, 2021 5:01 am

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.

Top