When the dialog is opened, the text area is focused. When enter is
pressed (and the form is submit) the window now behaves as expected and
adds the stream to the playlist and closes. The text area is now also
cleared once the form is submit, previously the old stream was still
visible when the dialog was opened a second time.
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.
init script: depend on $remote_fs instead of $local_fs. Reason: /usr can
be mounted a remote filesystem. Also depend on mpd (instead of $mpd,
which doesn't seem to exist.. at least on my system)
Also provide a default config (which should be installed as
/etc/default/ympd)
This commit makes the systemd unit file as well as the init script load
values from this configuration file so the user can change ympd settings
easily when running it as a service.