[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:
parent
38920a783a
commit
3c0d53831b
1 changed files with 4 additions and 1 deletions
|
@ -86,6 +86,9 @@ class Module(bumblebee.engine.Module):
|
||||||
self._status = "paused"
|
self._status = "paused"
|
||||||
|
|
||||||
if line.startswith("["):
|
if line.startswith("["):
|
||||||
|
if len(line.split(" ")) > 1:
|
||||||
|
timer = line.split(" ")[1]
|
||||||
|
else:
|
||||||
timer = line.split(" ")[1]
|
timer = line.split(" ")[1]
|
||||||
position = timer.split("/")[0]
|
position = timer.split("/")[0]
|
||||||
dur = timer.split("/")[1]
|
dur = timer.split("/")[1]
|
||||||
|
|
Loading…
Reference in a new issue