mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Fix shuffling artist & center top songs
This commit is contained in:
parent
64c6e4db79
commit
12e1c6f0c4
2 changed files with 71 additions and 65 deletions
|
|
@ -178,7 +178,7 @@ class ArtistViewModel
|
||||||
viewModelScope.launchIO {
|
viewModelScope.launchIO {
|
||||||
val request =
|
val request =
|
||||||
GetItemsRequest(
|
GetItemsRequest(
|
||||||
parentId = itemId,
|
artistIds = listOf(itemId),
|
||||||
fields = DefaultItemFields,
|
fields = DefaultItemFields,
|
||||||
recursive = true,
|
recursive = true,
|
||||||
includeItemTypes = listOf(BaseItemKind.AUDIO),
|
includeItemTypes = listOf(BaseItemKind.AUDIO),
|
||||||
|
|
@ -382,7 +382,9 @@ fun ArtistDetailsPage(
|
||||||
actions =
|
actions =
|
||||||
remember {
|
remember {
|
||||||
MusicButtonActions(
|
MusicButtonActions(
|
||||||
onClickPlay = { viewModel.play(artist) },
|
onClickPlay = { shuffled ->
|
||||||
|
viewModel.play(artist, shuffled = shuffled)
|
||||||
|
},
|
||||||
onClickInstantMix = { viewModel.startInstantMix(artist.id) },
|
onClickInstantMix = { viewModel.startInstantMix(artist.id) },
|
||||||
onClickFavorite = {
|
onClickFavorite = {
|
||||||
viewModel.setFavorite(
|
viewModel.setFavorite(
|
||||||
|
|
@ -437,6 +439,10 @@ fun ArtistDetailsPage(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
itemsIndexed(state.topSongs) { index, song ->
|
itemsIndexed(state.topSongs) { index, song ->
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
SongListItem(
|
SongListItem(
|
||||||
song = song,
|
song = song,
|
||||||
onClick = {
|
onClick = {
|
||||||
|
|
@ -492,7 +498,6 @@ fun ArtistDetailsPage(
|
||||||
isQueued = song != null && song.id in currentMusic.queuedIds,
|
isQueued = song != null && song.id in currentMusic.queuedIds,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.align(Alignment.Center)
|
|
||||||
.fillMaxWidth(.75f)
|
.fillMaxWidth(.75f)
|
||||||
.ifElse(
|
.ifElse(
|
||||||
position.row == SONG_ROW && position.column == index,
|
position.row == SONG_ROW && position.column == index,
|
||||||
|
|
@ -501,6 +506,7 @@ fun ArtistDetailsPage(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
item {
|
item {
|
||||||
ItemRow(
|
ItemRow(
|
||||||
title = stringResource(R.string.albums),
|
title = stringResource(R.string.albums),
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ suspend fun ViewModel.getPagerForArtist(
|
||||||
): ApiRequestPager<GetItemsRequest> {
|
): ApiRequestPager<GetItemsRequest> {
|
||||||
val request =
|
val request =
|
||||||
GetItemsRequest(
|
GetItemsRequest(
|
||||||
parentId = artistId,
|
artistIds = listOf(artistId),
|
||||||
recursive = true,
|
recursive = true,
|
||||||
includeItemTypes = listOf(BaseItemKind.AUDIO),
|
includeItemTypes = listOf(BaseItemKind.AUDIO),
|
||||||
fields = DefaultItemFields,
|
fields = DefaultItemFields,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue