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
5dac3729
Commit
5dac3729
authored
Oct 28, 2018
by
Mike Jones
🌶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let people other than me set/unset their Last.fm username
parent
394ef84d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
internal/app/modlastfm/command/artist.go
internal/app/modlastfm/command/artist.go
+2
-2
internal/app/modlastfm/command/init.go
internal/app/modlastfm/command/init.go
+1
-1
internal/app/modlastfm/command/user.go
internal/app/modlastfm/command/user.go
+7
-3
internal/app/modlastfm/gauntlet/run.go
internal/app/modlastfm/gauntlet/run.go
+1
-1
No files found.
internal/app/modlastfm/command/artist.go
View file @
5dac3729
...
...
@@ -7,7 +7,7 @@ import (
"github.com/n7st/lastfm-go/lastfm"
)
func
(
f
*
Fn
)
ArtistInfo
(
artist
string
)
string
{
func
(
f
*
Fn
)
ArtistInfo
(
artist
string
,
nickname
string
)
string
{
artistInfo
,
err
:=
f
.
getArtistInfo
(
artist
)
if
err
!=
nil
{
...
...
@@ -19,7 +19,7 @@ func (f *Fn) ArtistInfo(artist string) string {
// returns a comma separated list of tags, e.g.:
// death metal, old school death metal, danish, breakbeat, seen live
func
(
f
*
Fn
)
GetArtistTags
(
artist
string
)
string
{
func
(
f
*
Fn
)
GetArtistTags
(
artist
string
,
nickname
string
)
string
{
var
tags
=
"no tags"
res
,
err
:=
f
.
getArtistInfo
(
artist
)
...
...
internal/app/modlastfm/command/init.go
View file @
5dac3729
...
...
@@ -12,7 +12,7 @@ import (
type
(
FnCommand
func
(
message
string
,
username
string
)
string
OpenFnCommand
func
(
message
string
)
string
OpenFnCommand
func
(
message
string
,
nickname
string
)
string
)
type
Fn
struct
{
...
...
internal/app/modlastfm/command/user.go
View file @
5dac3729
...
...
@@ -14,18 +14,22 @@ const (
noTopArtistsForPeriodF
=
"%s has no listening data for this period"
)
func
(
f
*
Fn
)
SetUser
(
message
string
)
string
{
func
(
f
*
Fn
)
SetUser
(
message
string
,
nickname
string
)
string
{
var
err
error
if
message
==
""
{
err
=
f
.
Store
.
RemoveAssociatedUser
(
"Mike"
)
err
=
f
.
Store
.
RemoveAssociatedUser
(
nickname
)
if
err
!=
nil
{
return
fmtError
(
err
)
}
return
"Last.fm username unset"
}
args
:=
strings
.
Split
(
message
,
" "
)
err
=
f
.
Store
.
SetAssociatedUser
(
"Mike"
,
args
[
0
])
err
=
f
.
Store
.
SetAssociatedUser
(
nickname
,
args
[
0
])
if
err
!=
nil
{
return
fmtError
(
err
)
...
...
internal/app/modlastfm/gauntlet/run.go
View file @
5dac3729
...
...
@@ -69,7 +69,7 @@ func Run(nickname string, message string, db *store.BoltStore) string {
openFnCommand
:=
openCommands
[
arguments
[
0
]]
if
openFnCommand
!=
nil
{
return
openFnCommand
(
strings
.
Join
(
arguments
[
1
:
],
" "
))
return
openFnCommand
(
strings
.
Join
(
arguments
[
1
:
],
" "
)
,
nickname
)
}
return
""
...
...
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