Skip to content

Commit

Permalink
Fix cmus indicator trimming last chars of artist or song name
Browse files Browse the repository at this point in the history
  • Loading branch information
aonemd committed Mar 30, 2018
1 parent 6bc4332 commit 9511cad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/cmus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9511cad

Please sign in to comment.