Skip to content

Commit

Permalink
fix: try fix for z-huang#138 and z-huang#28
Browse files Browse the repository at this point in the history
  • Loading branch information
Malopieds committed Jun 26, 2024
1 parent b1c2ca6 commit 86c2950
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,14 @@ class HomeViewModel @Inject constructor(
val listItem = mutableListOf<YTItem>()
artist?.id?.let {
YouTube.artist(it).onSuccess { res ->
if (res.sections.size % 2 == 0) {
res.sections.getOrNull(res.sections.size - 2)?.items?.forEach { item ->
listItem.add(item)
}
res.sections.lastOrNull()?.items?.forEach { item ->
listItem.add(item)
if (res.artist.radioEndpoint != null && res.artist.shuffleEndpoint != null) {
if (res.sections.size % 2 == 0) {
res.sections.getOrNull(res.sections.size - 2)?.items?.forEach { item ->
listItem.add(item)
}
res.sections.lastOrNull()?.items?.forEach { item ->
listItem.add(item)
}
}
}
}
Expand Down

0 comments on commit 86c2950

Please sign in to comment.