forked from shkh/lastfm-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
radio.go
32 lines (28 loc) · 972 Bytes
/
radio.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
package lastfm
type radioApi struct {
params *apiParams
}
//radio.getPlaylist (auth required)
func (api radioApi) GetPlaylist(args map[string]interface{}) (result RadioGetPlaylist, err error) {
defer func() { appendCaller(err, "lastfm.Radio.GetPlaylist") }()
err = callPost("radio.getplaylist", api.params, args, &result, P{
"plain": []string{"discovery", "buylinks", "speed_multiplier", "bitrate", "rtp"},
})
return
}
//radio.search
func (api radioApi) Search(args map[string]interface{}) (result RadioSearch, err error) {
defer func() { appendCaller(err, "lastfm.Radio.Search") }()
err = callGet("radio.search", api.params, args, &result, P{
"plain": []string{"name"},
})
return
}
//radio.tune
func (api radioApi) Tune(args map[string]interface{}) (result RadioTune, err error) {
defer func() { appendCaller(err, "lastfm.Radio.Tune") }()
err = callPost("radio.tune", api.params, args, &result, P{
"plain": []string{"lang", "station"},
})
return
}