From d2bef950ba30e90f46dbe66ef879ff5b4f35ae2d Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 19 Aug 2017 16:23:38 +0200 Subject: [PATCH] [modules/cmus] Fix missing position/duration Wrong parameter was used as key value, so position and duration were missing. --- bumblebee/modules/cmus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/cmus.py b/bumblebee/modules/cmus.py index e854b67..a442d55 100644 --- a/bumblebee/modules/cmus.py +++ b/bumblebee/modules/cmus.py @@ -69,15 +69,17 @@ class Module(bumblebee.engine.Module): return returns.get(widget.name, self._status) def _eval_line(self, line): + line = line.encode("utf-8", "replace") items = line.split(" ", 2) name, key, value = (line.split(" ", 2) + [None, None])[:3] if name == "status": self._status = key if name == "tag": + print("tag {}={}".format(key, value)) self._tags.update({key: value}) if name in ["duration", "position"]: - self._tags.update({key:bumblebee.util.durationfmt(int(key))}) + self._tags.update({name:bumblebee.util.durationfmt(int(key))}) if name == "set" and key == "repeat": self._repeat = value == "true" if name == "set" and key == "shuffle":