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, album: &Album,
) -> Result<Vec<Match<Album>>, Error> { ) -> Result<Vec<Match<Album>>, Error> {
let mut request = SearchReleaseGroupRequest::default(); let mut request = SearchReleaseGroupRequest::default();
request request.arid(arid);
.arid(arid)
.release_group(&album.id.title)
.first_release_date(&album.date);
if let Some(ref mbref) = album.musicbrainz { if let Some(ref mbref) = album.musicbrainz {
request.rgid(mbref.mbid()); 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)?; let mb_response = self.client.search_release_group(request)?;
Ok(mb_response Ok(mb_response
.release_groups .release_groups
.into_iter() .into_iter()