Maloja listens import

This commit is contained in:
Philipp Wolfer 2023-11-14 08:41:53 +01:00
parent ca745038e3
commit 5a85987476
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
5 changed files with 118 additions and 1 deletions

View file

@ -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
}