mpd: Support albums in browse

Albums are also containers of tracks, similar to directories and
playlists. Treat them equally when browsing.
This commit is contained in:
Trygve Aaberge 2014-06-21 01:51:36 +02:00
parent cf051d243a
commit 5b8a9a3fb4

View File

@ -293,7 +293,7 @@ class MpdContext(object):
for part in path_parts:
for ref in self.core.library.browse(uri).get():
if (ref.type in (ref.DIRECTORY, ref.PLAYLIST) and
if (ref.type in (ref.DIRECTORY, ref.ALBUM, ref.PLAYLIST) and
ref.name == part):
uri = ref.uri
break
@ -308,7 +308,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 in (ref.DIRECTORY, ref.PLAYLIST):
if ref.type in (ref.DIRECTORY, ref.ALBUM, ref.PLAYLIST):
yield (path, None)
if recursive:
path_and_futures.append(