Commit dc007e2f authored by Mike Jones's avatar Mike Jones 🌶

Prettify error, fix tags and similar artists if empty

parent 2c818f8c
......@@ -12,6 +12,10 @@ func (f *Fn) ArtistInfo(artist string, nickname string) string {
artistInfo, err := f.getArtistInfo(artist)
if err != nil {
if strings.HasPrefix(err.Error(), "LastfmError[6]") {
return "The artist you supplied could not be found"
}
return fmtError(err)
}
......@@ -25,7 +29,7 @@ func (f *Fn) GetArtistTags(artist string, nickname string) string {
res, err := f.getArtistInfo(artist)
if err == nil {
if err == nil && len(res.Tags) > 0 {
tags = fmtArtistTags(res)
}
......@@ -87,5 +91,9 @@ func fmtArtistSimilar(artist lastfm.ArtistGetInfo) string {
s = append(s, artist.Similars[i].Name)
}
return strings.Join(s, ", ")
if len(s) > 0 {
return strings.Join(s, ", ")
}
return "none"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment