playback: fix add to queue again
This commit is contained in:
parent
b43586c1ea
commit
c42da2240c
1 changed files with 11 additions and 2 deletions
|
@ -68,6 +68,9 @@ class BetterShuffleOrder(private val shuffled: IntArray) : ShuffleOrder {
|
||||||
return BetterShuffleOrder(insertionCount, -1)
|
return BetterShuffleOrder(insertionCount, -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Fix this scuffed hacky logic
|
||||||
|
// TODO: Play next ordering needs to persist in unshuffle
|
||||||
|
|
||||||
val newShuffled = IntArray(shuffled.size + insertionCount)
|
val newShuffled = IntArray(shuffled.size + insertionCount)
|
||||||
val pivot: Int =
|
val pivot: Int =
|
||||||
if (insertionIndex < shuffled.size) {
|
if (insertionIndex < shuffled.size) {
|
||||||
|
@ -87,9 +90,15 @@ class BetterShuffleOrder(private val shuffled: IntArray) : ShuffleOrder {
|
||||||
newShuffled[i + insertionCount] = currentIndex
|
newShuffled[i + insertionCount] = currentIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (insertionIndex < shuffled.size) {
|
||||||
for (i in 0 until insertionCount) {
|
for (i in 0 until insertionCount) {
|
||||||
newShuffled[pivot + i + 1] = insertionIndex + i + 1
|
newShuffled[pivot + i + 1] = insertionIndex + i + 1
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (i in 0 until insertionCount) {
|
||||||
|
newShuffled[pivot + i] = insertionIndex + i
|
||||||
|
}
|
||||||
|
}
|
||||||
return BetterShuffleOrder(newShuffled)
|
return BetterShuffleOrder(newShuffled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue