From 241e5ec59cd2062c39f1c41feb6c161fe2a0d2fc Mon Sep 17 00:00:00 2001 From: p-storm Date: Thu, 26 Dec 2019 13:52:07 +0100 Subject: [PATCH] supported more tags --- bumblebee/modules/mpd.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/mpd.py b/bumblebee/modules/mpd.py index 939f6e0..6e0d32c 100644 --- a/bumblebee/modules/mpd.py +++ b/bumblebee/modules/mpd.py @@ -79,7 +79,27 @@ class Module(bumblebee.engine.Module): def _load_song(self): info = "" try: - info = bumblebee.util.execute('mpc -f "tag artist %artist%\ntag title %title%"' + self._hostcmd) + tags = {'name', + 'artist', + 'album', + 'albumartist', + 'comment', + 'composer', + 'date', + 'originaldate', + 'disc', + 'genre', + 'performer', + 'title', + 'track', + 'time', + 'file', + 'id', + 'prio', + 'mtime', + 'mdate'} + joinedtags = "\n".join(["tag {0} %{0}%".format(tag) for tag in tags]) + info = bumblebee.util.execute('mpc -f ' + '"' + joinedtags + '"' + self._hostcmd) except RuntimeError: pass self._tags = defaultdict(lambda: '')