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:
1 parent
53dbff219e
commit
dfbf64b1a4
1 file changed
+8
-4
@@ -407,11 +407,15 @@ 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 {
|
||||||
|
members.push(related);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
members.push(related);
|
// We're viewing a PERSON, the related artist is a BAND/GROUP
|
||||||
|
groups.push(related);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"collaboration" => {
|
"collaboration" => {
|
||||||
|
|||||||
Reference in new issue
Block a user