From 6c4ecae0686010121ca764a8d573d0b0fc73b9a6 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Fri, 20 Jun 2014 20:31:09 +0200 Subject: [PATCH] mpd: Support playlists in browse Playlists are containers similar to directories. Treat them equally to support playlists when browsing. --- mopidy/mpd/dispatcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mopidy/mpd/dispatcher.py b/mopidy/mpd/dispatcher.py index c2a4cb46..30e72be3 100644 --- a/mopidy/mpd/dispatcher.py +++ b/mopidy/mpd/dispatcher.py @@ -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(