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

Parsing errors when strings contains quotation marks #29

Open
Moon-0xff opened this issue Aug 7, 2021 · 0 comments · May be fixed by #30
Open

Parsing errors when strings contains quotation marks #29

Moon-0xff opened this issue Aug 7, 2021 · 0 comments · May be fixed by #30

Comments

@Moon-0xff
Copy link

If an artist or song name contains a ", it's not parsed completely
the string is cut off just before the first instance of a quotation mark.
As in this song:
Epitaph - Including "March for No Reason" and "Tomorrow and Tomorrow"
gets displayed as:
Epitaph (Including ) - King Crimson

This is because of how this extension extracts both strings from d-bus

  var titleBlock = data.substring(data.indexOf("xesam:title"));
  var title = titleBlock.split("\"")[2]

  var artistBlock = data.substring(data.indexOf("xesam:artist"));
  var artist = artistBlock.split("\"")[2]

As you can see, it gets artist and title from a string(substring?) surrounded by quotation marks, so if either string have a quotation mark somewhere it gets cut.

I have a fix to this for a week now (and few others).
I will submit a pull request right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant