Fetch loses albums with CannotHaveMbid as mb_ref #259
@ -212,6 +212,10 @@ impl AppMachine<MatchState> {
|
|||||||
mh.set_artist_mb_ref(&matches.matching.id, tuple.mb_ref)
|
mh.set_artist_mb_ref(&matches.matching.id, tuple.mb_ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn filter_mb_ref(left: &AlbumMbRef, right: &AlbumMbRef) -> bool {
|
||||||
|
(left == right) && !matches!(left, AlbumMbRef::CannotHaveMbid)
|
||||||
|
}
|
||||||
|
|
||||||
fn select_album(
|
fn select_album(
|
||||||
inner: &mut AppInner,
|
inner: &mut AppInner,
|
||||||
matches: &AlbumMatches,
|
matches: &AlbumMatches,
|
||||||
@ -225,7 +229,7 @@ impl AppMachine<MatchState> {
|
|||||||
let iter = artist.albums.iter();
|
let iter = artist.albums.iter();
|
||||||
let filtered = iter
|
let filtered = iter
|
||||||
.filter(|album| album.meta.id != matches.matching)
|
.filter(|album| album.meta.id != matches.matching)
|
||||||
.filter(|album| album.meta.id.mb_ref == tuple.mb_ref);
|
.filter(|album| Self::filter_mb_ref(&album.meta.id.mb_ref, &tuple.mb_ref));
|
||||||
clashing.extend(filtered.map(|a| &a.meta.id).cloned())
|
clashing.extend(filtered.map(|a| &a.meta.id).cloned())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user