Small clean up

This commit is contained in:
Wojciech Kozlowski 2024-09-28 12:15:42 +02:00
parent b0ac9bf2c1
commit c130519adf

View File

@ -27,11 +27,11 @@ macro_rules! item_option_artist_set {
meta: &ArtistMeta,
) -> Result<(), musichoard::Error> {
let mut info = meta.info.clone();
info.musicbrainz = match self {
MatchOption::Some(m) => m.item.info.musicbrainz,
MatchOption::CannotHaveMbid => MbRefOption::CannotHaveMbid,
match self {
MatchOption::Some(m) => info.musicbrainz = m.item.info.musicbrainz,
MatchOption::CannotHaveMbid => info.musicbrainz = MbRefOption::CannotHaveMbid,
MatchOption::ManualInputMbid => panic!(),
};
}
music_hoard.set_artist_info(&meta.id, info)
}
}
@ -51,15 +51,11 @@ macro_rules! item_option_album_set {
meta: &AlbumMeta,
) -> Result<(), musichoard::Error> {
let mut info = meta.info.clone();
(info.musicbrainz, info.primary_type, info.secondary_types) = match self {
MatchOption::Some(m) => (
m.item.info.musicbrainz,
m.item.info.primary_type,
m.item.info.secondary_types,
),
MatchOption::CannotHaveMbid => (MbRefOption::CannotHaveMbid, None, Vec::new()),
match self {
MatchOption::Some(m) => info = m.item.info,
MatchOption::CannotHaveMbid => info.musicbrainz = MbRefOption::CannotHaveMbid,
MatchOption::ManualInputMbid => panic!(),
};
}
music_hoard.set_album_info(artist, &meta.id, info)
}
}