Merge pull request #1501 from mook/1500-mpd-utf8

[Players - mpd] Use Unicode where available
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2015-11-28 22:49:06 +03:00
commit 78c6c730ca
1 changed files with 5 additions and 1 deletions

View File

@ -189,7 +189,11 @@ class MpdPlayerSegment(PlayerSegment):
'total': now_playing[3],
}
else:
client = mpd.MPDClient()
try:
client = mpd.MPDClient(use_unicode=True)
except TypeError:
# python-mpd 1.x does not support use_unicode
client = mpd.MPDClient()
client.connect(host, port)
if password:
client.password(password)