fix(musicbrainz): correct member/group relationship logic

When viewing a BAND: direction=backward means related is a MEMBER
When viewing a PERSON: direction=forward means related is a GROUP

cc
This commit is contained in:
vicrodh committed 2026-01-25 20:11:44 -06:00
1 parent 53dbff219e
commit dfbf64b1a4
1 file changed
+6 -2
+6 -2
View File
@@ -407,12 +407,16 @@ fn extract_relationships(artist: &ArtistFullResponse) -> ArtistRelationships {
match relation.relation_type.as_str() { match relation.relation_type.as_str() {
"member of band" => { "member of band" => {
if relation.direction.as_deref() == Some("backward") { if relation.direction.as_deref() == Some("backward") {
groups.push(related); // We're viewing a BAND, the related artist is a MEMBER
} else if relation.ended == Some(true) { if relation.ended == Some(true) {
past_members.push(related); past_members.push(related);
} else { } else {
members.push(related); members.push(related);
} }
} else {
// We're viewing a PERSON, the related artist is a BAND/GROUP
groups.push(related);
}
} }
"collaboration" => { "collaboration" => {
collaborators.push(related); collaborators.push(related);