Skip to content

Commit

Permalink
fix(): try fix for #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Malopieds committed Mar 31, 2024
1 parent d8e1138 commit 33d2d13
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ class HomeViewModel @Inject constructor(
val listItem = mutableListOf<YTItem>()
artist?.id?.let {
YouTube.artist(it).onSuccess { res ->
res.sections.getOrNull(res.sections.size - 2)?.items?.forEach { item ->
listItem.add(item)
}
res.sections.lastOrNull()?.items?.forEach {item ->
listItem.add(item)
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 33d2d13

Please sign in to comment.