Skip to content

Commit

Permalink
Adding messaging when a song isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrencecraft committed Mar 4, 2016
1 parent eed42ac commit fb42f59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,18 @@ func BuildPlaylist(authedClient *spotify.Client, songs []EchoesSong, market stri
fmt.Println("Possible problem with track", song.Title,
"by", song.Artist, "or the Spotify API. Please contact lawrencecraft on github")
} else {
found := false
for _, track := range result.Tracks.Tracks {
if isValidForMarket(track, market) {
tracks = append(tracks, track)
found = true
break
}
}

if !found {
fmt.Println("Unable to find", song.Title, "by", song.Artist)
}
}
case err := <-errorChannel:
fmt.Println("Got an error:", err)
Expand Down

0 comments on commit fb42f59

Please sign in to comment.