Fix the bug I've introduced in my PR #78, breaking the add
track/playlist action. We have to decode URIs before sending them back
to our socket!
fixes#80
Previously, browsing entities with non-ascii characters in their URI
under Safari wouldn't work. Directories would be empty, songs wouldn't
be added. I haven't tried it, but this behavior seems to be common to
Webkit-based browsers, so Chrome would be affected too.
This turned out to be because Safari normalizes all unicode strings to
NFC, breaking the link with MPD-spewed URIs, which are in NFD.
An obvious fix would have been to normalize all URIs to NFD, but
unfortunately, Safari doesn't have `str.normalize()`. Adding
normalization capabilities to our JS side would have involved
introductiing libraries such as `unorm`, which is rather big.
We could have done it on the C side, but it involves introducing `icu`,
which is far from trivial too.
After much fussing around, I stumbled on a simple solution: URI-encode
our URI when creating our browser table row. This magically prevents
Safari from trying to mess with our unicode form before we get the
chance to send it back to our server.
This change allows easier implementation of different backends because the websocket URL isn't identical to the webpage URL. This does not affect the functionality of the default C backend.
This is to comply with the Debian Free Software Guidelines:
https://www.debian.org/social_contract#guidelines
ympd can still use the minified file, however we need the source files
to be included in the source package.