diff --git a/docs/changelog.rst b/docs/changelog.rst index 60fcafbd..bf09b81e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -60,13 +60,22 @@ MPD frontend - Add "not implemented" skeletons of new commands in the MPD protocol version 0.19: - - ``rangeid`` - - ``addtagid`` - - ``cleartagid`` - - ``mount`` - - ``unmount`` - - ``listmounts`` - - ``listneighbors`` + - Current playlist: + + - ``rangeid`` + - ``addtagid`` + - ``cleartagid`` + + - Mounts and neighbors: + + - ``mount`` + - ``unmount`` + - ``listmounts`` + - ``listneighbors`` + + - Music DB: + + - ``listfiles`` File backend ------------ diff --git a/mopidy/mpd/protocol/music_db.py b/mopidy/mpd/protocol/music_db.py index f9d77d5b..ddd8f9f7 100644 --- a/mopidy/mpd/protocol/music_db.py +++ b/mopidy/mpd/protocol/music_db.py @@ -349,6 +349,29 @@ def listallinfo(context, uri=None): return result +@protocol.commands.add('listfiles') +def listfiles(context, uri=None): + """ + *musicpd.org, music database section:* + + ``listfiles [URI]`` + + Lists the contents of the directory URI, including files are not + recognized by MPD. URI can be a path relative to the music directory or + an URI understood by one of the storage plugins. The response contains + at least one line for each directory entry with the prefix "file: " or + "directory: ", and may be followed by file attributes such as + "Last-Modified" and "size". + + For example, "smb://SERVER" returns a list of all shares on the given + SMB/CIFS server; "nfs://servername/path" obtains a directory listing + from the NFS server. + + .. versionadded:: MPD protocol 0.19 + """ + raise exceptions.MpdNotImplemented # TODO + + @protocol.commands.add('lsinfo') def lsinfo(context, uri=None): """ diff --git a/tests/mpd/protocol/test_music_db.py b/tests/mpd/protocol/test_music_db.py index b1f5f7c8..5fe40e0d 100644 --- a/tests/mpd/protocol/test_music_db.py +++ b/tests/mpd/protocol/test_music_db.py @@ -295,6 +295,10 @@ class MusicDatabaseHandlerTest(protocol.BaseTestCase): self.assertInResponse('directory: /dummy/a') self.assertInResponse('directory: /dummy/a [2]') + def test_listfiles(self): + self.send_request('listfiles') + self.assertEqualResponse('ACK [0@0] {listfiles} Not implemented') + def test_lsinfo_without_path_returns_same_as_for_root(self): last_modified = 1390942873222 self.backend.playlists.set_dummy_playlists([