diff --git a/components/cmus.go b/components/cmus.go index ec9d6d8..79e2f7f 100644 --- a/components/cmus.go +++ b/components/cmus.go @@ -16,8 +16,8 @@ func main() { artistPattern, _ := regexp.Compile("tag artist .*") titlePattern, _ := regexp.Compile("tag title .*") - artist := strings.Trim(artistPattern.FindString(string(response)), "tag artist") - title := strings.Trim(titlePattern.FindString(string(response)), "tag title") + artist := strings.TrimPrefix(artistPattern.FindString(string(response)), "tag artist ") + title := strings.TrimPrefix(titlePattern.FindString(string(response)), "tag title ") if artist != "" && title != "" { fmt.Println(fmt.Sprintf(" %s - %s", artist, title))