Trim metadata in spotify block
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-03-07 13:26:02 +01:00
parent 64908e4eb4
commit 64629c2d23
No known key found for this signature in database
GPG key ID: 477F8D32E8E286EB

View file

@ -2,10 +2,16 @@ package main
import ( import (
"fmt" "fmt"
r "gitnet.fr/deblan/i3-blocks-go/rendering" sos"
"os" "os/"
"os/exec"
"strings" "strings"
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-go/rendering"
) )
func GetMetadata(metadata string) string { func GetMetadata(metadata string) string {
@ -20,11 +26,15 @@ func GetMetadata(metadata string) string {
} }
func GetTitle() string { func GetTitle() string {
return GetMetadata("xesam:title") data := GetMetadata("xesam:title")
return strings.Trim(string(data), "\n")
} }
func GetArtist() string { func GetArtist() string {
return GetMetadata("xesam:artist") data := GetMetadata("xesam:artist")
return strings.Trim(string(data), "\n")
} }
func GetStatus() string { func GetStatus() string {