From 3aec82c40c7699ef0f2930ae9793a48b7251b73f Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 24 Apr 2021 18:03:03 +0100 Subject: fix upload.py args for new version --- main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index d765d9f..eacd904 100644 --- a/main.go +++ b/main.go @@ -97,11 +97,10 @@ func playerJSON(p *mpris2.Player) string { text += v + right } out += "\",\"text\":\"" + text + "\"," - out += "\"tooltip\":\"" + fmt.Sprintf( - "%s\\nby %s\\n", - strings.ReplaceAll(p.Title, "&", "&"), - strings.ReplaceAll(p.Artist, "&", "&"), - ) + out += "\"tooltip\":\"" + strings.ReplaceAll(p.Title, "&", "&") + "\\n" + if p.Artist != "" { + out += "by " + strings.ReplaceAll(p.Artist, "&", "&") + "\\n" + } if p.Album != "" { out += "from " + strings.ReplaceAll(p.Album, "&", "&") + "\\n" } -- cgit v1.2.3