Decide carefully where external::musicbrainz belongs #196

Merged
wojtek merged 11 commits from 193---decide-carefully-where-external--musicbrainz-belongs into main 2024-08-28 18:21:13 +02:00
Showing only changes of commit 54dee15713 - Show all commits

View File

@ -28,15 +28,17 @@ impl<Http: IMusicBrainzHttp> IMusicBrainz for MusicBrainz<Http> {
album: &Album,
) -> Result<Vec<Match<Album>>, Error> {
let mut request = SearchReleaseGroupRequest::default();
request
.arid(arid)
.release_group(&album.id.title)
.first_release_date(&album.date);
request.arid(arid);
if let Some(ref mbref) = album.musicbrainz {
request.rgid(mbref.mbid());
} else {
request
.first_release_date(&album.date)
.release_group(&album.id.title);
}
let mb_response = self.client.search_release_group(request)?;
Ok(mb_response
.release_groups
.into_iter()