mpd: Enable browsing of empty dirs
This was disabled together with a bunch of other changes without any
explanation in commit f24ca36e5a. I'm
guessing that this wasn't intentional, and no test covered the case.
This commit is contained in:
parent
33e3fe9173
commit
4e508cd017
@ -421,8 +421,6 @@ def lsinfo(context, uri=None):
|
|||||||
if uri in (None, '', '/'):
|
if uri in (None, '', '/'):
|
||||||
result.extend(protocol.stored_playlists.listplaylists(context))
|
result.extend(protocol.stored_playlists.listplaylists(context))
|
||||||
|
|
||||||
if not result:
|
|
||||||
raise exceptions.MpdNoExistError('Not found')
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -351,6 +351,13 @@ class MusicDatabaseHandlerTest(protocol.BaseTestCase):
|
|||||||
self.assertInResponse('directory: dummy/foo')
|
self.assertInResponse('directory: dummy/foo')
|
||||||
self.assertInResponse('OK')
|
self.assertInResponse('OK')
|
||||||
|
|
||||||
|
def test_lsinfo_for_empty_dir_returns_nothing(self):
|
||||||
|
self.backend.library.dummy_browse_result = {
|
||||||
|
'dummy:/': []}
|
||||||
|
|
||||||
|
self.sendRequest('lsinfo "/dummy"')
|
||||||
|
self.assertInResponse('OK')
|
||||||
|
|
||||||
def test_lsinfo_for_dir_does_not_recurse(self):
|
def test_lsinfo_for_dir_does_not_recurse(self):
|
||||||
self.backend.library.dummy_library = [
|
self.backend.library.dummy_library = [
|
||||||
Track(uri='dummy:/a', name='a'),
|
Track(uri='dummy:/a', name='a'),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user