diff --git a/app/src/main/java/com/malopieds/innertune/ui/menu/PlayerMenu.kt b/app/src/main/java/com/malopieds/innertune/ui/menu/PlayerMenu.kt index 69d1485b3..3ee2ccde8 100644 --- a/app/src/main/java/com/malopieds/innertune/ui/menu/PlayerMenu.kt +++ b/app/src/main/java/com/malopieds/innertune/ui/menu/PlayerMenu.kt @@ -102,6 +102,11 @@ fun PlayerMenu( val download by LocalDownloadUtil.current.getDownload(mediaMetadata.id).collectAsState(initial = null) + val artists = + remember(mediaMetadata.artists) { + mediaMetadata.artists.filter { it.id != null } + } + var showChoosePlaylistDialog by rememberSaveable { mutableStateOf(false) } @@ -194,7 +199,7 @@ fun PlayerMenu( ListDialog( onDismiss = { showSelectArtistDialog = false }, ) { - items(mediaMetadata.artists) { artist -> + items(artists) { artist -> Box( contentAlignment = Alignment.CenterStart, modifier = @@ -323,16 +328,18 @@ fun PlayerMenu( } } } - GridMenuItem( - icon = R.drawable.artist, - title = R.string.view_artist, - ) { - if (mediaMetadata.artists.size == 1) { - navController.navigate("artist/${mediaMetadata.artists[0].id}") - playerBottomSheetState.collapseSoft() - onDismiss() - } else { - showSelectArtistDialog = true + if (artists.isNotEmpty()) { + GridMenuItem( + icon = R.drawable.artist, + title = R.string.view_artist, + ) { + if (mediaMetadata.artists.size == 1) { + navController.navigate("artist/${mediaMetadata.artists[0].id}") + playerBottomSheetState.collapseSoft() + onDismiss() + } else { + showSelectArtistDialog = true + } } } if (mediaMetadata.album != null) {