mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 21:57:06 +02:00
ListenBrainz: Support import of loves without recording MBID
This commit is contained in:
parent
1b5ea241b6
commit
4d18a207ee
6 changed files with 68 additions and 5 deletions
|
@ -125,3 +125,22 @@ func (c Client) SendFeedback(feedback Feedback) (result StatusResult, err error)
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (c Client) Lookup(recordingName string, artistName string) (result LookupResult, err error) {
|
||||
const path = "/metadata/lookup"
|
||||
errorResult := ErrorResult{}
|
||||
response, err := c.HttpClient.R().
|
||||
SetQueryParams(map[string]string{
|
||||
"recording_name": recordingName,
|
||||
"artist_name": artistName,
|
||||
}).
|
||||
SetResult(&result).
|
||||
SetError(&errorResult).
|
||||
Get(path)
|
||||
|
||||
if response.StatusCode() != 200 {
|
||||
err = errors.New(errorResult.Error)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue