From 7b7fb90449358da7d4e529e8703906773b109ffb Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sat, 31 Jul 2021 13:32:03 +0200 Subject: [PATCH] Show unique `artist_id` and `name` pairs only once in TrackRow (#258) --- .../main/java/me/vanpetegem/accentor/ui/tracks/TrackRow.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/me/vanpetegem/accentor/ui/tracks/TrackRow.kt b/app/src/main/java/me/vanpetegem/accentor/ui/tracks/TrackRow.kt index 52d52501..1b349c68 100644 --- a/app/src/main/java/me/vanpetegem/accentor/ui/tracks/TrackRow.kt +++ b/app/src/main/java/me/vanpetegem/accentor/ui/tracks/TrackRow.kt @@ -100,8 +100,10 @@ fun TrackRow( Text(stringResource(R.string.go_to_album)) } } + val used = HashSet>() for (ta in track.trackArtists.sortedBy { ta -> ta.order }) { - if (ta.artistId != hideArtist) { + if (ta.artistId != hideArtist && !used.contains(Pair(ta.artistId, ta.name))) { + used.add(Pair(ta.artistId, ta.name)) DropdownMenuItem( onClick = { expanded = false