[modules/mpd] Fixed song duration parse bug

After listening to an audio stream for longer than 10 minutes "mpc -f "tag artist %artist%\ntag title %title%"" will start producing lines with slightly different separation, which caused the bar to fail.
This commit is contained in:
max-kov 2017-10-20 12:22:42 +01:00
parent 38920a783a
commit 3c0d53831b

View file

@ -86,6 +86,9 @@ class Module(bumblebee.engine.Module):
self._status = "paused"
if line.startswith("["):
if len(line.split(" ")) > 1:
timer = line.split(" ")[1]
else:
timer = line.split(" ")[1]
position = timer.split("/")[0]
dur = timer.split("/")[1]