From 59b4338f814359577a154bffa75aa471a5be9a0f Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 14 Dec 2011 14:04:00 -0800 Subject: [PATCH] fix BPD lsinfo results for libmpc (#277) --- beetsplug/bpd/__init__.py | 6 +++++- docs/changelog.rst | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/beetsplug/bpd/__init__.py b/beetsplug/bpd/__init__.py index fe9dbe96a..ae1c84399 100644 --- a/beetsplug/bpd/__init__.py +++ b/beetsplug/bpd/__init__.py @@ -797,7 +797,11 @@ class Server(BaseServer): item = self.lib.get_item(itemid) yield self._item_info(item) for name, _ in node.dirs.iteritems(): - yield u'directory: ' + self._path_join(path, name) + dirpath = self._path_join(path, name) + if dirpath.startswith(u"/"): + # Strip leading slash (libmpc rejects this). + dirpath = dirpath[1:] + yield u'directory: %s' % dirpath def _listall(self, basepath, node, info=False): """Helper function for recursive listing. If info, show diff --git a/docs/changelog.rst b/docs/changelog.rst index 8d8cf80d3..2760eb42b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,8 @@ Changelog 1.0b12 (in development) ----------------------- +* Fix an incompatibility in BPD with libmpc (the library that powers mpc and + ncmpc). 1.0b11 (December 12, 2011) --------------------------