mpd: List browse results before playlists in lsinfo

This makes directories from extensions appear before playlists in the
result of the lsinfo command, which is desirable in clients that does
not sort the result.
This commit is contained in:
Trygve Aaberge 2014-06-21 14:03:05 +02:00
parent b81a9569c8
commit 21cf0f0337

View File

@ -408,9 +408,6 @@ def lsinfo(context, uri=None):
""``, and ``lsinfo "/"``.
"""
result = []
if uri in (None, '', '/'):
result.extend(protocol.stored_playlists.listplaylists(context))
for path, lookup_future in context.browse(uri, recursive=False):
if not lookup_future:
result.append(('directory', path.lstrip('/')))
@ -419,6 +416,9 @@ def lsinfo(context, uri=None):
if tracks:
result.extend(translator.track_to_mpd_format(tracks[0]))
if uri in (None, '', '/'):
result.extend(protocol.stored_playlists.listplaylists(context))
if not result:
raise exceptions.MpdNoExistError('Not found')
return result