Fix Characters 1.0.3 - choose what to update

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: Fix Characters 1.0.3 - choose what to update

Re: Fix Characters 1.0.3 - choose what to update

by gb63 » Mon Sep 26, 2022 10:43 am

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é"

Re: Fix Characters 1.0.3 - choose what to update

by drakinite » Thu Apr 07, 2022 1:19 pm

Doesn't have any issues for me.
Image
Are your JS text files being saved in UTF-8 or a different text encoding method?

Re: Fix Characters 1.0.3 - choose what to update

by MPG » Thu Apr 07, 2022 11:38 am

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.

Re: Upgrading Addon "fixCharacter"

by drakinite » Fri Mar 18, 2022 9:59 am

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

Upgrading Addon "fixCharacter"

by freelifenow » Fri Mar 18, 2022 5:04 am

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

Re: Fix Characters 1.0.3 - choose what to update

by Shankfist » Fri Mar 18, 2022 3:59 am

Great stuff, thanks!

Re: Fix Characters 1.0.3 - choose what to update

by MPG » Thu Mar 17, 2022 5:03 pm

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!

Fix Characters 1.0.3 - choose what to update

by Shankfist » Thu Mar 17, 2022 10:38 am

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.

Top