forked from shkh/lastfm-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
artist.go
171 lines (152 loc) · 5.7 KB
/
artist.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package lastfm
type artistApi struct {
params *apiParams
}
//artist.addTags
func (api artistApi) AddTags(args map[string]interface{}) (err error) {
defer func() { appendCaller(err, "lastfm.Artist.AddTags") }()
err = callPost("artist.addtags", api.params, args, nil, P{
"plain": []string{"artist", "tags"},
})
return
}
//artist.getCorrection
func (api artistApi) GetCorrection(args map[string]interface{}) (result ArtistGetCorrection, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetCorrection") }()
err = callGet("artist.getcorrection", api.params, args, &result, P{
"plain": []string{"artist"},
})
return
}
//artist.getEvents
func (api artistApi) GetEvents(args map[string]interface{}) (result ArtistGetEvents, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetEvents") }()
err = callGet("artist.getevents", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "autocorrect", "limit", "page", "festivalsonly"},
})
return
}
//artist.getInfo
func (api artistApi) GetInfo(args map[string]interface{}) (result ArtistGetInfo, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetInfo") }()
if _, ok := args["username"]; !ok && api.params.sk != "" {
err = callPost("artist.getinfo", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "lang", "autocorrect"},
})
} else {
err = callGet("artist.getinfo", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "lang", "autocorrect", "username"},
})
}
return
}
//artist.getPastEvents
func (api artistApi) GetPastEvents(args map[string]interface{}) (result ArtistGetPastEvents, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetPastEvents") }()
err = callGet("artist.getpastevents", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "page", "autocorrect", "limit"},
})
return
}
//artist.getPodcast
func (api artistApi) GetPodcast(args map[string]interface{}) (result ArtistGetPodcast, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetPodcast") }()
err = callGet("artist.getpodcast", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "autocorrect"},
})
return
}
//artist.getShouts
func (api artistApi) GetShouts(args map[string]interface{}) (result ArtistGetShouts, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetShouts") }()
err = callGet("artist.getshouts", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "limit", "autocorrect", "page"},
})
return
}
//artist.getSimilar
func (api artistApi) GetSimilar(args map[string]interface{}) (result ArtistGetSimilar, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetSimilar") }()
err = callGet("artist.getsimilar", api.params, args, &result, P{
"plain": []string{"limit", "artist", "autocorrect", "mbid"},
})
return
}
//artist.getTags
func (api artistApi) GetTags(args map[string]interface{}) (result ArtistGetTags, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetTags") }()
if _, ok := args["user"]; !ok && api.params.sk != "" {
err = callGet("artist.gettags", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "user", "autocorrect"},
})
} else {
err = callGet("artist.gettags", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "user", "autocorrect"},
})
}
return
}
//artist.getTopAlbums
func (api artistApi) GetTopAlbums(args map[string]interface{}) (result ArtistGetTopAlbums, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetTopAlbums") }()
err = callGet("artist.gettopalbums", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "autocorrect", "page", "limit"},
})
return
}
//artist.getTopFans
func (api artistApi) GetTopFans(args map[string]interface{}) (result ArtistGetTopFans, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetTopFans") }()
err = callGet("artist.gettopfans", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "autocorrect"},
})
return
}
//artist.getTopTags
func (api artistApi) GetTopTags(args map[string]interface{}) (result ArtistGetTopTags, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetTopTags") }()
err = callGet("artist.gettoptags", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "autocorrect"},
})
return
}
//artist.getTopTracks
func (api artistApi) GetTopTracks(args map[string]interface{}) (result ArtistGetTopTracks, err error) {
defer func() { appendCaller(err, "lastfm.Artist.GetTopTracks") }()
err = callGet("artist.gettoptracks", api.params, args, &result, P{
"plain": []string{"artist", "mbid", "autocorrect", "page", "limit"},
})
return
}
//artist.removeTag
func (api artistApi) RemoveTag(args map[string]interface{}) (err error) {
defer func() { appendCaller(err, "lastfm.Artist.RemoveTag") }()
err = callPost("artist.removetag", api.params, args, nil, P{
"plain": []string{"artist", "tag"},
})
return
}
//artist.search
func (api artistApi) Search(args map[string]interface{}) (result ArtistSearch, err error) {
defer func() { appendCaller(err, "lastfm.Artist.Search") }()
err = callGet("artist.search", api.params, args, &result, P{
"plain": []string{"limit", "page", "artist"},
})
return
}
//artist.share
func (api artistApi) Share(args map[string]interface{}) (err error) {
defer func() { appendCaller(err, "lastfm.Artist.Share") }()
err = callPost("artist.share", api.params, args, nil, P{
"plain": []string{"artist", "recipient", "message", "public"},
})
return
}
//artist.shout
func (api artistApi) Shout(args map[string]interface{}) (err error) {
defer func() { appendCaller(err, "lastfm.Artist.Shout") }()
err = callPost("artist.shout", api.params, args, nil, P{
"plain": []string{"artist", "message"},
})
return
}