]> kaliko git repositories - mpd-sima.git/commitdiff
MPD client: Use command list to add multiple tracks
authorkaliko <kaliko@azylum.org>
Sun, 10 May 2020 14:21:35 +0000 (16:21 +0200)
committerkaliko <kaliko@azylum.org>
Sun, 10 May 2020 14:21:35 +0000 (16:21 +0200)
sima/mpdclient.py

index 13aa0b01c3cca749c922d8cfc0f6ba61309b2e85..afc51dc4691e087fb4e5b351e3a732d53f390a98 100644 (file)
@@ -249,8 +249,10 @@ class MPD(MPDClient):
         if isinstance(payload, Track):
             super().__getattr__('add')(payload.file)
         elif isinstance(payload, list):
+            self.command_list_ok_begin()
             for tr in payload:  # TODO: use send command here
                 self.add(tr)
+            results = client.command_list_end()
         else:
             self.log.error('Cannot add %s', payload)