]> kaliko git repositories - python-musicpd.git/commitdiff
adding listplaylists command
authorJ. Alexander Treuman <jat@spatialrift.net>
Mon, 1 Jun 2009 21:53:40 +0000 (17:53 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Mon, 1 Jun 2009 21:53:40 +0000 (17:53 -0400)
doc/commands.txt
mpd.py

index 68f6ed2cd568c3bbee4053eabbb968da111de458..df8058a43869371845038b4b224594961bf0b42d 100644 (file)
@@ -43,6 +43,7 @@ swapid           <int> <int>       -> getnone
 == Stored Playlist Commands
 listplaylist     <str>             -> getlist
 listplaylistinfo <str>             -> getsongs
+listplaylists                      -> getplaylists
 load             <str>             -> getnone
 playlistadd      <str> <str>       -> getnone
 playlistclear    <str>             -> getnone
diff --git a/mpd.py b/mpd.py
index d7aaf5d46306831895564a53a9f43f2b4361ebdb..3a5d8675ba195f617bd8c0e37880da071e4c8bf2 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -92,6 +92,7 @@ class MPDClient(object):
             # Stored Playlist Commands
             "listplaylist":     self._getlist,
             "listplaylistinfo": self._getsongs,
+            "listplaylists":    self._getplaylists,
             "load":             self._getnone,
             "playlistadd":      self._getnone,
             "playlistclear":    self._getnone,
@@ -262,6 +263,9 @@ class MPDClient(object):
     def _getsongs(self):
         return self._getobjects(["file"])
 
+    def _getplaylists(self):
+        return self._getobjects(["playlist"])
+
     def _getdatabase(self):
         return self._getobjects(["file", "directory", "playlist"])