From 97e4ccbbd9a87931d1701f6e241d736f9931b2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johann=20Kl=C3=A4hn?= Date: Wed, 11 Dec 2013 12:04:39 +0100 Subject: [PATCH] expand '~' in host in mpdstats --- beetsplug/mpdstats.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py index 56d1816db..6fad39eea 100644 --- a/beetsplug/mpdstats.py +++ b/beetsplug/mpdstats.py @@ -64,6 +64,10 @@ class Client(object): """ host = config['mpd']['host'].get(unicode) port = config['mpd']['port'].get(int) + + if host[0] in ['/', '~']: + host = os.path.expanduser(host) + log.info(u'mpdstats: connecting to {0}:{1}'.format(host, port)) try: self.client.connect(host, port)