mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2026-10-26 16:45:23 +00:00
Fix Previous episode button showing on the first episode
adjacentTo returns [current, next] on the first episode, and the old code took the first sibling that was not the current item, so it picked the next episode as the previous one. Only count an item that sits before the current one.
This commit is contained in:
1 parent
b6fa1bf1ac
commit
7fb9d9de3e
1 file changed
+2
-4
@@ -217,10 +217,8 @@ fun FullDetailsFragment.populatePreviousButton() {
|
||||
).content
|
||||
}
|
||||
|
||||
val previousItem = siblings.items
|
||||
.filterNot { it.id == mBaseItem.id }
|
||||
.firstOrNull()
|
||||
?.id
|
||||
val currentIndex = siblings.items.indexOfFirst { it.id == mBaseItem.id }
|
||||
val previousItem = siblings.items.getOrNull(currentIndex - 1)?.id
|
||||
|
||||
mPrevItemId = previousItem
|
||||
mPrevButton.isVisible = previousItem != null
|
||||
|
||||
Reference in new issue
Block a user