mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 21:57:06 +02:00
Maloja listens import
This commit is contained in:
parent
ca745038e3
commit
5a85987476
5 changed files with 118 additions and 1 deletions
|
@ -61,3 +61,18 @@ func (c Client) GetScrobbles(page int, perPage int) (result GetScrobblesResult,
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (c Client) NewScrobble(scrobble NewScrobble) (result NewScrobbleResult, err error) {
|
||||
const path = "/apis/mlj_1/newscrobble"
|
||||
scrobble.Key = c.token
|
||||
response, err := c.HttpClient.R().
|
||||
SetBody(scrobble).
|
||||
SetResult(&result).
|
||||
Post(path)
|
||||
|
||||
if response.StatusCode() != 200 {
|
||||
err = errors.New(response.String())
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue