From 54dee1571339339ed575f5b7c0ca98fa4599b86c Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Wed, 28 Aug 2024 15:07:17 +0200 Subject: [PATCH] Minor nit --- src/tui/lib/external/musicbrainz/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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()