From 38f61298f8c432a1815a06eda4dc7824632735d7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 25 Sep 2018 09:42:46 +0200 Subject: [PATCH] Support for bulk mpd add --- platypush/plugins/music/mpd/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platypush/plugins/music/mpd/__init__.py b/platypush/plugins/music/mpd/__init__.py index 2de251af..fb31ab40 100644 --- a/platypush/plugins/music/mpd/__init__.py +++ b/platypush/plugins/music/mpd/__init__.py @@ -208,6 +208,15 @@ class MusicMpdPlugin(MusicPlugin): :type resource: str """ + if isinstance(resource, list): + for r in resource: + try: + self._exec('add', r) + except Exception as e: + self.logger.warning('Could not add {}: {}'.format(r, e)) + + return self.status().output + return self._exec('add', resource) @action