Merge pull request #749 from trygveaa/feature/mpd-browse-playlists

mpd: Support playlists in browse
This commit is contained in:
Thomas Adamcik 2014-06-20 21:08:27 +02:00
commit e3e9ce253f

View File

@ -295,7 +295,8 @@ class MpdContext(object):
for part in path_parts:
for ref in self.core.library.browse(uri).get():
if ref.type == ref.DIRECTORY and ref.name == part:
if ((ref.type == ref.DIRECTORY or ref.type == ref.PLAYLIST) and
ref.name == part):
uri = ref.uri
break
else:
@ -309,7 +310,7 @@ class MpdContext(object):
base_path, future = path_and_futures.pop()
for ref in future.get():
path = '/'.join([base_path, ref.name.replace('/', '')])
if ref.type == ref.DIRECTORY:
if ref.type == ref.DIRECTORY or ref.type == ref.PLAYLIST:
yield (path, None)
if recursive:
path_and_futures.append(