]> kaliko git repositories - python-musicpd.git/blobdiff - musicpd.py
Add readpicture command
[python-musicpd.git] / musicpd.py
index 3425a6f7f84fd9d37f3ffdd1a749d24b19dacbc0..008d9d8d4838539fad90031ce538d166971fe5b7 100644 (file)
@@ -233,6 +233,7 @@ class MPDClient:
             "listfiles":          self._fetch_database,
             "lsinfo":             self._fetch_database,
             "readcomments":       self._fetch_object,
+            "readpicture":        self._fetch_composite,
             "search":             self._fetch_songs,
             "searchadd":          self._fetch_nothing,
             "searchaddpl":        self._fetch_nothing,
@@ -542,6 +543,10 @@ class MPDClient:
             obj[key] = value
             if key == 'binary':
                 break
+        if not obj:
+            # If the song file was recognized, but there is no picture, the
+            # response is successful, but is otherwise empty.
+            return obj
         amount = int(obj['binary'])
         try:
             obj['data'] = self._read_binary(amount)