[modules/cmus] Fix missing position/duration
Wrong parameter was used as key value, so position and duration were missing.
This commit is contained in:
parent
054ad96ec2
commit
d2bef950ba
1 changed files with 3 additions and 1 deletions
|
@ -69,15 +69,17 @@ class Module(bumblebee.engine.Module):
|
||||||
return returns.get(widget.name, self._status)
|
return returns.get(widget.name, self._status)
|
||||||
|
|
||||||
def _eval_line(self, line):
|
def _eval_line(self, line):
|
||||||
|
line = line.encode("utf-8", "replace")
|
||||||
items = line.split(" ", 2)
|
items = line.split(" ", 2)
|
||||||
name, key, value = (line.split(" ", 2) + [None, None])[:3]
|
name, key, value = (line.split(" ", 2) + [None, None])[:3]
|
||||||
|
|
||||||
if name == "status":
|
if name == "status":
|
||||||
self._status = key
|
self._status = key
|
||||||
if name == "tag":
|
if name == "tag":
|
||||||
|
print("tag {}={}".format(key, value))
|
||||||
self._tags.update({key: value})
|
self._tags.update({key: value})
|
||||||
if name in ["duration", "position"]:
|
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":
|
if name == "set" and key == "repeat":
|
||||||
self._repeat = value == "true"
|
self._repeat = value == "true"
|
||||||
if name == "set" and key == "shuffle":
|
if name == "set" and key == "shuffle":
|
||||||
|
|
Loading…
Reference in a new issue