From 1d2374a3989b404237e84e69b00577ac87b1a2fd Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Sun, 20 Aug 2023 11:44:23 +0200 Subject: [PATCH] Ignore parsefloat errors --- events.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/events.go b/events.go index eec3fa2..c1700bf 100644 --- a/events.go +++ b/events.go @@ -374,16 +374,8 @@ func (app *App) songPosition(payload ...interface{}) { msg := make(map[string]interface{}) out := make(map[string]interface{}) - slen, err := strconv.ParseFloat(status["duration"], 64) - if err != nil { - log.Println(err) - return - } - - spos, err := strconv.ParseFloat(status["elapsed"], 64) - if err != nil { - return - } + slen, _ := strconv.ParseFloat(status["duration"], 64) + spos, _ := strconv.ParseFloat(status["elapsed"], 64) msg["event"] = "song_position" out["len"] = time.Duration(slen * float64(time.Second)).Milliseconds()