ListenBrainz: Support import of loves without recording MBID

This commit is contained in:
Philipp Wolfer 2023-11-13 18:49:20 +01:00
parent 1b5ea241b6
commit 4d18a207ee
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
6 changed files with 68 additions and 5 deletions

View file

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