Fix Characters 1.0.3 - choose what to update

Get help for different MediaMonkey 5 Addons.

Moderators: jiri, drakinite, Addon Administrators

Shankfist
Posts: 18
Joined: Sat Jan 20, 2018 4:41 am

Fix Characters 1.0.3 - choose what to update

Post by Shankfist »

With Fix Characters 1.0.3 is there a way to select which fields it does and doesn't update? For example, I'm happy for it to change all my track numbers to a uniform format (01 instead of 1) but I'd like to keep the umlaut in Motörhead and not add a space between the slash in AC/DC.
MPG
Posts: 418
Joined: Tue May 13, 2008 11:22 pm

Re: Fix Characters 1.0.3 - choose what to update

Post by MPG »

Hi,
Unfortunately, with the current release, it doesn't offer that feature. I think what would suit you best is the ability to have exclusions. I don't believe it would be too hard to implement. I'll take a look at it early next week, and hopefully have something released mid to late next week.

For now, if you go into the source code, scroll down to the following line in the dlgFixCharacters.js file:
strArtist = RemoveAccents(FixCommonWords(FixBrackets(ChangeCharacters(FixForwardSlash(objTrack.title)))));

change it to:
strArtist = FixCommonWords(FixBrackets(ChangeCharacters(FixForwardSlash(objTrack.title))));

That will leave all accents in the artist name, which may or may not be what you're looking for. Be sure to restart MM after you make the change.

Thank you for using my utility!
TIA
MPG
Triumph - Hold On: Music holds the secret, to know it can make you whole.
Shankfist
Posts: 18
Joined: Sat Jan 20, 2018 4:41 am

Re: Fix Characters 1.0.3 - choose what to update

Post by Shankfist »

Great stuff, thanks!
freelifenow
Posts: 1
Joined: Fri Dec 31, 2021 5:07 am

Upgrading Addon "fixCharacter"

Post by freelifenow »

Hello,
my music is often downloaded from youtube and the titles have a lot of unused information like :
"(Audio)", "(audio)", "(AUDIO)", "(Official Audio)", "Lyrics", "LYRICS", "Lyric", "LYRIC", "(lyrics)", "(music video)", "(music Video)", "(Music video)", "(Music Video)", "(Lyric Video)", "(Video)", "(video)", "(ON VIDEO)","(Official Video)", "(Official)", "(Original Video)", "(Extended Version)", "(Lyric Video)", "(offizielles Musikvideo)" etc.

On base of the fixcharacters addon, I use an array and a loop, to remove this text, remove the actors and some other details. After many hours of programming, try & error it works well. (JavaScript is not my prefered language :evil: ) ...

My Questions:
1.) There was now way, to use multidemeinsionale arrays like abc[x,y] - has mm5 a restriction in this case ?
2.) I havn´t found a way, to load the text to be changed from an ASCII-File into an array in the addon to become flexible - is the "mm5 javascript syntax" limited or can the whole normal functions of js can be used ?

There are a few other addons, I had programmed (in a lot of tea-times), but they are individual and have german explinations, so you wouldn´t understand them. I think, it wouldn´t be helpful to upload them.

Thanks for any tipps & tricks

Gerorge
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Upgrading Addon "fixCharacter"

Post by drakinite »

freelifenow wrote: Fri Mar 18, 2022 5:04 am
1.) There was now way, to use multidemeinsionale arrays like abc[x,y] - has mm5 a restriction in this case ?
2.) I havn´t found a way, to load the text to be changed from an ASCII-File into an array in the addon to become flexible - is the "mm5 javascript syntax" limited or can the whole normal functions of js can be used ?
It makes sense to answer 2) first: MM5 uses a recent version of Chromium under the hood, so any code that will work in a browser will also work in MM5. But there are many native additions to the engine which enable communication with the database and OS, most of which are in the native App object: https://www.mediamonkey.com/docs/api/classes/App.html
See app.filesystem.loadTextFromFileAsync: https://www.mediamonkey.com/docs/api/cl ... mFileAsync

1) Multidimensional arrays in JavaScript use the following syntax:
abc[x][y]
They mention multidim. arrays on this page: https://developer.mozilla.org/en-US/doc ... eps/Arrays
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.
MPG
Posts: 418
Joined: Tue May 13, 2008 11:22 pm

Re: Fix Characters 1.0.3 - choose what to update

Post by MPG »

Hi,
I wanted to give an update on this request. Thanks to this suggestion, I found a bug in my code that has now been resolved. The problem now is that Javascript does not like umlaut characters. When I do the following:
Tag = ReplaceBadTagPortion(Tag, "Motorhead", "Motörhead")

function ReplaceBadTagPortion(Tag, fromValue, toValue) {
if(Tag.toLowerCase() == fromValue.toLowerCase()){
Tag = toValue;
}
}
Tag is set to: Motörhead

Maybe someone in the forum has a suggestion on how to make Javascript work with these characters.
TIA
MPG
Triumph - Hold On: Music holds the secret, to know it can make you whole.
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Fix Characters 1.0.3 - choose what to update

Post by drakinite »

Doesn't have any issues for me.
Image
Are your JS text files being saved in UTF-8 or a different text encoding method?
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.
gb63
Posts: 3
Joined: Fri Jun 17, 2022 2:11 am
Location: Fr

Re: Fix Characters 1.0.3 - choose what to update

Post by gb63 »

If I want keep accent :
In dlgFixCharacters.js , I replace in function init

Code: Select all

strArtist = RemoveAccents(FixCommonWords...)
by

Code: Select all

strArtist = FixCommonWords...
and in function MapXML(original) in the loop :

Code: Select all

hold.substr(1, i-1)
by

Code: Select all

hold.substr(0, i)
Otherwise I don't see some caracters (1 by changed caracter) in the report :
"Collectif Métissé" become "llectif Métissé"
Post Reply