Fix Characters 1.0.3 - choose what to update
Moderators: jiri, drakinite, Addon Administrators
Fix Characters 1.0.3 - choose what to update
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.
Re: Fix Characters 1.0.3 - choose what to update
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!
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.
MPG
Triumph - Hold On: Music holds the secret, to know it can make you whole.
Re: Fix Characters 1.0.3 - choose what to update
Great stuff, thanks!
-
- Posts: 1
- Joined: Fri Dec 31, 2021 5:07 am
Upgrading Addon "fixCharacter"
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 ) ...
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
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 ) ...
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
Re: Upgrading Addon "fixCharacter"
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.htmlfreelifenow 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 ?
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
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.
Re: Fix Characters 1.0.3 - choose what to update
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.
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.
MPG
Triumph - Hold On: Music holds the secret, to know it can make you whole.
Re: Fix Characters 1.0.3 - choose what to update
Doesn't have any issues for me.
Are your JS text files being saved in UTF-8 or a different text encoding method?
Are your JS text files being saved in UTF-8 or a different text encoding method?
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.
Re: Fix Characters 1.0.3 - choose what to update
If I want keep accent :
In dlgFixCharacters.js , I replace in function init
by
and in function MapXML(original) in the loop :
by
Otherwise I don't see some caracters (1 by changed caracter) in the report :
"Collectif Métissé" become "llectif Métissé"
In dlgFixCharacters.js , I replace in function init
Code: Select all
strArtist = RemoveAccents(FixCommonWords...)
Code: Select all
strArtist = FixCommonWords...
Code: Select all
hold.substr(1, i-1)
Code: Select all
hold.substr(0, i)
"Collectif Métissé" become "llectif Métissé"