Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem adding Albums with greek characters from both database and filesystem #60

Closed
ghost opened this issue Sep 26, 2018 · 5 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Sep 26, 2018

I have lots of albums with greek characters on both tags and filenames/directories. All of them appear in filesystem and database views but the options "Append to queue/Replace queue/Add to playlist" menu
never appears on them if I click on the album cover in database view or on the cross symbol in filesystem view.

I don't know if it happens with other languages too. I can only test with Greek.

The myMPD version I use is 4.2.1.

@Emilot
Copy link

Emilot commented Sep 26, 2018

Error message:

InvalidCharacterError: String contains an invalid character mympd.min.js:113
addMenuItem
http://192.168.0.207/js/mympd.min.js:113:135
showMenu
http://192.168.0.207/js/mympd.min.js:115:135
appInit/<
http://192.168.0.207/js/mympd.min.js:36:372

If i click on then song name, the song added successfully in the queue.
From Menu at the left, it throws the error i mention. Even in the queue(if i added it through click on the name as i mention) i cannot remove the song if i wanted to, because when i click on the "+", throws the same error.

@jcorporation
Copy link
Owner

Can you test it with non-minified files and post the error here?

@jcorporation jcorporation added the bug Something isn't working label Sep 26, 2018
@Emilot
Copy link

Emilot commented Sep 26, 2018

One is at line 1716, which is this function:
function addMenuItem(href, text) {
return '<a class="dropdown-item" href="#" data-href='' + btoa(JSON.stringify(href)) + ''>' + text +'';
}

The other is 1743 line:
menu += addMenuItem({"cmd": "appendQueue", "options": [type, uri, name]}, 'Append to queue') +

and the other is 434 line:
else if (event.target.nodeName == 'A') {
showMenu(event.target, event);
}

InvalidCharacterError: String contains an invalid character mympd.min.js:1716
addMenuItem
http://192.168.0.207/js/mympd.min.js:1716:63
showMenu
http://192.168.0.207/js/mympd.min.js:1743:17
appInit/<
http://192.168.0.207/js/mympd.min.js:434:13

@jcorporation
Copy link
Owner

It seems it is a unicode problem of base44 encode and decode: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding

I implemented the solution 1 in linked document in the devel branch. Can you please test it?

@Emilot
Copy link

Emilot commented Sep 26, 2018

Case closed. One more annoying bug goes down.

Thanx JC. Great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants