diff --git a/src/core/interface/musicbrainz/mod.rs b/src/core/interface/musicbrainz/mod.rs index d8b4f7a..a59a348 100644 --- a/src/core/interface/musicbrainz/mod.rs +++ b/src/core/interface/musicbrainz/mod.rs @@ -22,7 +22,7 @@ pub struct MbidError(String); impl fmt::Display for MbidError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.0) + write!(f, "failed to parse a MBID: {}", self.0) } } diff --git a/src/external/musicbrainz/api/lookup.rs b/src/external/musicbrainz/api/lookup.rs index 70968e8..41e4f07 100644 --- a/src/external/musicbrainz/api/lookup.rs +++ b/src/external/musicbrainz/api/lookup.rs @@ -20,15 +20,16 @@ impl MusicBrainzClient { ) -> Result { let mut include: Vec = vec![]; - let mbid: String = request.mbid.uuid().as_hyphenated().to_string(); - if request.release_groups { include.push(String::from("release-groups")); } let include: String = form_urlencoded::byte_serialize(include.join("+").as_bytes()).collect(); - let url = format!("{MB_BASE_URL}/artist/{mbid}?inc={include}"); + let url = format!( + "{MB_BASE_URL}/artist/{mbid}?inc={include}", + mbid = request.mbid.uuid().as_hyphenated() + ); let response: DeserializeLookupArtistResponse = self.http.get(&url)?; Ok(response.into())