mpd: Enable browsing of empty dirs
This was disabled together with a bunch of other changes without any explanation in commitf24ca36e5a. I'm guessing that this wasn't intentional, and no test covered the case. (cherry picked from commit4e508cd017)
This commit is contained in:
parent
a00bfb7fa1
commit
6e55435aa9
@ -421,8 +421,6 @@ def lsinfo(context, uri=None):
|
||||
if uri in (None, '', '/'):
|
||||
result.extend(protocol.stored_playlists.listplaylists(context))
|
||||
|
||||
if not result:
|
||||
raise exceptions.MpdNoExistError('Not found')
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@ -347,6 +347,13 @@ class MusicDatabaseHandlerTest(protocol.BaseTestCase):
|
||||
self.assertInResponse('directory: dummy/foo')
|
||||
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):
|
||||
self.backend.library.dummy_library = [
|
||||
Track(uri='dummy:/a', name='a'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user