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

Cannot add songs with " ' " in their filenames #50

Closed
Emilot opened this issue Sep 11, 2018 · 12 comments
Closed

Cannot add songs with " ' " in their filenames #50

Emilot opened this issue Sep 11, 2018 · 12 comments
Labels
bug Something isn't working
Milestone

Comments

@Emilot
Copy link

Emilot commented Sep 11, 2018

Describe the bug
Cannot add songs with " ' " in their filenames

To Reproduce
Steps to reproduce the behavior:

  1. Go to Search tab
  2. Click on a song that has " ' " in the name(for ex. Don't go)
  3. See error

Expected behavior
To be added at queue

Screenshots
untitled-1

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version latest
@jcorporation jcorporation added the bug Something isn't working label Sep 11, 2018
@jcorporation
Copy link
Owner

Does it work, if you click on the song title?

@jcorporation jcorporation added this to the v4.1.1 milestone Sep 12, 2018
@Emilot
Copy link
Author

Emilot commented Sep 12, 2018

If i click on the song title it will be added successfully.

@jcorporation
Copy link
Owner

Thanks for your confirmation. I think I found the bug

@Emilot
Copy link
Author

Emilot commented Sep 12, 2018

👍

@jcorporation
Copy link
Owner

Should now be fixed in devel. Can you test it?

@Emilot
Copy link
Author

Emilot commented Sep 12, 2018

SyntaxError: JSON.parse: unterminated string at line 1 column 133 of the JSON data[Learn More] mympd.min.js:121:1
showMenu/</<
http://192.168.0.206/js/mympd.min.js:121:1

Same error jc...

@Emilot
Copy link
Author

Emilot commented Sep 12, 2018

var cmd = JSON.parse(dh.replace(/'/g, '"'));

If i replace minified with normal js the Web Console indicate this line when i hit "Append to queue".

I do not know if it helps somewhere.

@Emilot
Copy link
Author

Emilot commented Sep 12, 2018

Oh you have another one here:

el.addEventListener('shown.bs.popover', function(event) {
    document.getElementsByClassName('popover-content')[0].addEventListener('click', function(event) {
        event.preventDefault();
        event.stopPropagation();
        if (event.target.nodeName == 'A') {
            var dh = event.target.getAttribute('data-href');
            if (dh) {
                **var cmd = JSON.parse(dh.replace(/\'/g, '"'));**

@jcorporation
Copy link
Owner

var cmd = JSON.parse(dh);
is here right. But this doesn't fix the bug.
It seems that saving the ouptut of JSON.stringify can't be saved in a data-* attribute in the dom, if it contains ' or " characters in values.

Encoding the output in base64 works. I commited the fix in devel.

@Emilot
Copy link
Author

Emilot commented Sep 13, 2018

Perfect jc

Case closed!

Thank you.

@ideonaudio
Copy link

Hi JC,

Is this the same issue?

error mympd

I tried to add an album with " ' " in title... Sgt. Pepper's - Beatles

@jcorporation
Copy link
Owner

Is an another issue, please open a new issue and attach debug logs of myMPD and verbose logs of mpd. If JavaScript errors occurs these also.

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

3 participants