[Players - mpd] Use Unicode where available
Otherwise the mpd function will fail when it encounters non-ASCII metadata as it tries to do a unicode.format() and attempts to decode the incoming data as ASCII, throwing a UnicodeDecodeError exception. Fixes #1500
This commit is contained in:
parent
eaa772f195
commit
4265da2e1d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue