From 1c5b07a37451e9835b4a129756669f82ca2f39a3 Mon Sep 17 00:00:00 2001 From: Thomas Kemmer Date: Fri, 24 Oct 2014 12:47:58 +0200 Subject: [PATCH] Make everything that is not a Track browseable --- mopidy/mpd/dispatcher.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/mopidy/mpd/dispatcher.py b/mopidy/mpd/dispatcher.py index 9c2f3471..c947c13d 100644 --- a/mopidy/mpd/dispatcher.py +++ b/mopidy/mpd/dispatcher.py @@ -299,8 +299,7 @@ class MpdContext(object): uri = None for part in path_parts: for ref in self.core.library.browse(uri).get(): - if (ref.type in (ref.DIRECTORY, ref.ALBUM, ref.PLAYLIST) - and ref.name == part): + if ref.type != ref.TRACK and ref.name == part: uri = ref.uri break else: @@ -320,13 +319,13 @@ class MpdContext(object): path = '/'.join([base_path, ref.name.replace('/', '')]) path = self.insert_name_uri_mapping(path, ref.uri) - if ref.type in (ref.DIRECTORY, ref.ALBUM, ref.PLAYLIST): - yield (path, None) - if recursive: - path_and_futures.append( - (path, self.core.library.browse(ref.uri))) - elif ref.type == ref.TRACK: + if ref.type == ref.TRACK: if lookup: yield (path, self.core.library.lookup(ref.uri)) else: yield (path, ref) + else: + yield (path, None) + if recursive: + path_and_futures.append( + (path, self.core.library.browse(ref.uri)))