From 6bb667ae822cca86d195d4398bb7f19feaf7d9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Sun, 20 Nov 2022 14:44:24 +0300 Subject: Fix duplicate output crashing --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.go') 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()) } } -- cgit v1.2.3