Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
modlastfm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
stella-irc
modlastfm
Commits
dc007e2f
Commit
dc007e2f
authored
Jan 01, 2019
by
Mike Jones
🌶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettify error, fix tags and similar artists if empty
parent
2c818f8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
internal/app/modlastfm/command/artist.go
internal/app/modlastfm/command/artist.go
+10
-2
No files found.
internal/app/modlastfm/command/artist.go
View file @
dc007e2f
...
@@ -12,6 +12,10 @@ func (f *Fn) ArtistInfo(artist string, nickname string) string {
...
@@ -12,6 +12,10 @@ func (f *Fn) ArtistInfo(artist string, nickname string) string {
artistInfo
,
err
:=
f
.
getArtistInfo
(
artist
)
artistInfo
,
err
:=
f
.
getArtistInfo
(
artist
)
if
err
!=
nil
{
if
err
!=
nil
{
if
strings
.
HasPrefix
(
err
.
Error
(),
"LastfmError[6]"
)
{
return
"The artist you supplied could not be found"
}
return
fmtError
(
err
)
return
fmtError
(
err
)
}
}
...
@@ -25,7 +29,7 @@ func (f *Fn) GetArtistTags(artist string, nickname string) string {
...
@@ -25,7 +29,7 @@ func (f *Fn) GetArtistTags(artist string, nickname string) string {
res
,
err
:=
f
.
getArtistInfo
(
artist
)
res
,
err
:=
f
.
getArtistInfo
(
artist
)
if
err
==
nil
{
if
err
==
nil
&&
len
(
res
.
Tags
)
>
0
{
tags
=
fmtArtistTags
(
res
)
tags
=
fmtArtistTags
(
res
)
}
}
...
@@ -87,5 +91,9 @@ func fmtArtistSimilar(artist lastfm.ArtistGetInfo) string {
...
@@ -87,5 +91,9 @@ func fmtArtistSimilar(artist lastfm.ArtistGetInfo) string {
s
=
append
(
s
,
artist
.
Similars
[
i
]
.
Name
)
s
=
append
(
s
,
artist
.
Similars
[
i
]
.
Name
)
}
}
return
strings
.
Join
(
s
,
", "
)
if
len
(
s
)
>
0
{
return
strings
.
Join
(
s
,
", "
)
}
return
"none"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment