Skip to content

Commit

Permalink
Use private entry index in QueueService
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Dec 21, 2024
1 parent c18a68a commit 1adb9b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions playback/core/src/main/kotlin/queue/QueueService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ class QueueService internal constructor() : PlayerService(), Queue {
val repeatMode = if (useRepeatMode) state.repeatMode.value else RepeatMode.NONE

return when (repeatMode) {
RepeatMode.NONE -> provider.provideIndices(amount, estimatedSize, currentQueueIndicesPlayed, entryIndex.value)
RepeatMode.NONE -> provider.provideIndices(amount, estimatedSize, currentQueueIndicesPlayed, _entryIndex.value)

RepeatMode.REPEAT_ENTRY_ONCE -> buildList(amount) {
add(entryIndex.value)
addAll(provider.provideIndices(amount - 1, estimatedSize, currentQueueIndicesPlayed, entryIndex.value))
add(_entryIndex.value)
addAll(provider.provideIndices(amount - 1, estimatedSize, currentQueueIndicesPlayed, _entryIndex.value))
}.take(amount)

RepeatMode.REPEAT_ENTRY_INFINITE -> List(amount) { entryIndex.value }
RepeatMode.REPEAT_ENTRY_INFINITE -> List(amount) { _entryIndex.value }
}
}

Expand Down

0 comments on commit 1adb9b0

Please sign in to comment.