Fix shuffling artist & center top songs

This commit is contained in:
Damontecres 2026-03-21 17:13:04 -04:00
parent 64c6e4db79
commit 12e1c6f0c4
No known key found for this signature in database
2 changed files with 71 additions and 65 deletions

View file

@ -178,7 +178,7 @@ class ArtistViewModel
viewModelScope.launchIO {
val request =
GetItemsRequest(
parentId = itemId,
artistIds = listOf(itemId),
fields = DefaultItemFields,
recursive = true,
includeItemTypes = listOf(BaseItemKind.AUDIO),
@ -382,7 +382,9 @@ fun ArtistDetailsPage(
actions =
remember {
MusicButtonActions(
onClickPlay = { viewModel.play(artist) },
onClickPlay = { shuffled ->
viewModel.play(artist, shuffled = shuffled)
},
onClickInstantMix = { viewModel.startInstantMix(artist.id) },
onClickFavorite = {
viewModel.setFavorite(
@ -437,6 +439,10 @@ fun ArtistDetailsPage(
)
}
itemsIndexed(state.topSongs) { index, song ->
Box(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center,
) {
SongListItem(
song = song,
onClick = {
@ -492,7 +498,6 @@ fun ArtistDetailsPage(
isQueued = song != null && song.id in currentMusic.queuedIds,
modifier =
Modifier
.align(Alignment.Center)
.fillMaxWidth(.75f)
.ifElse(
position.row == SONG_ROW && position.column == index,
@ -501,6 +506,7 @@ fun ArtistDetailsPage(
)
}
}
}
item {
ItemRow(
title = stringResource(R.string.albums),

View file

@ -235,7 +235,7 @@ suspend fun ViewModel.getPagerForArtist(
): ApiRequestPager<GetItemsRequest> {
val request =
GetItemsRequest(
parentId = artistId,
artistIds = listOf(artistId),
recursive = true,
includeItemTypes = listOf(BaseItemKind.AUDIO),
fields = DefaultItemFields,