Skip to content

Commit

Permalink
Make sure track titles use dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Klishin committed Feb 15, 2013
1 parent e58d7f1 commit acb77e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func recentTracksFor(genre string) ([]Track, error) {
}

var adTrackTitle, _ = regexp.Compile(`^TSTAG.*`)
var separatorRe, _ = regexp.Compile(`\s-\s`)

func displayAdTrack(t Track) {
fmt.Print("* /advertisement/\n")
Expand All @@ -146,7 +147,7 @@ func displayAdTrack(t Track) {
func displayMusicTrack(t Track) {
a := t.Artist
ti := t.Title
tr := t.Track
tr := separatorRe.ReplaceAllString(t.Track, " — ")

if len(a) > 0 {
fmt.Printf("* %s — %s\n", a, ti)
Expand Down

0 comments on commit acb77e8

Please sign in to comment.