From 7a7810de50c92254d0a2e85a02e4d3d6f68a9516 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Mon, 18 Mar 2024 00:23:44 +0100 Subject: [PATCH] Fix IndexOutOfBoundsException --- music/build.gradle.kts | 2 +- .../src/main/kotlin/dev/schlaubi/mikmusic/player/Queue.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/music/build.gradle.kts b/music/build.gradle.kts index fd26ebdd0..602da9f52 100644 --- a/music/build.gradle.kts +++ b/music/build.gradle.kts @@ -1,3 +1,3 @@ subprojects { - version = "3.5.16-SNAPSHOT" + version = "3.5.17-SNAPSHOT" } diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/Queue.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/Queue.kt index f24faa523..cc79639da 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/Queue.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/Queue.kt @@ -12,7 +12,7 @@ class Queue(private var tracksList: MutableList = mutableListOf()) order = LinkedList(order.shuffled()) } else { val queue = order.subList(0, nextIndex) - val shuffled = order.subList(nextIndex.coerceAtMost(order.lastIndex), tracksList.size) + val shuffled = order.subList(nextIndex.coerceAtMost(order.lastIndex), order.size) val unShuffled = queue + shuffled.sorted() nextIndex = tracksList.size