aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-11-20 14:44:24 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-11-20 14:44:24 +0300
commit6bb667ae822cca86d195d4398bb7f19feaf7d9eb (patch)
treedf9eb8489c4c365372dcaa74526b0b0d9e35888a
parent07ca4c3ff48d490ec1b9ee3b0ff7a992016577ca (diff)
downloadwaybar-mpris-6bb667ae822cca86d195d4398bb7f19feaf7d9eb.tar.gz
waybar-mpris-6bb667ae822cca86d195d4398bb7f19feaf7d9eb.zip
Fix duplicate output crashingHEADmaster
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.go b/main.go
index 10be005..dcde8a3 100644
--- a/main.go
+++ b/main.go
@@ -201,7 +201,6 @@ func formatOutput(p *player, icon string, fstr string, maxTitleLen int) string {
case tokPosition:
var position string
if p.Length > 0 {
- p.GetPosition()
position = secondsToString(int(p.Position / 1000000))
} else {
position = secondsToString(0)
@@ -646,6 +645,7 @@ func main() {
time.Sleep(POLL * time.Millisecond)
if len(players.mpris2.List) != 0 {
if players.mpris2.List[players.mpris2.Current].Playing {
+ players.mpris2.List[players.mpris2.Current].GetPosition()
go fmt.Fprintln(writer, players.JSON())
}
}