diff --git a/src/tui/lib/external/musicbrainz/mod.rs b/src/tui/lib/external/musicbrainz/mod.rs index 7cf35fd..b702bdf 100644 --- a/src/tui/lib/external/musicbrainz/mod.rs +++ b/src/tui/lib/external/musicbrainz/mod.rs @@ -28,15 +28,17 @@ impl IMusicBrainz for MusicBrainz { album: &Album, ) -> Result>, 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()