Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Dec 7, 2024
1 parent e3a4c91 commit e4926b4
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,30 @@ class RadioQueue(private val symphony: Symphony) {
}

val originalQueue = ConcurrentList<String>()
private set
val currentQueue = ConcurrentList<String>()
private set

var currentSongIndex = -1
set(value) {
private set(value) {
field = value
symphony.radio.onUpdate.dispatch(Radio.Events.Queue.IndexChanged)
}

var currentShuffleMode = false
set(value) {
private set(value) {
field = value
symphony.radio.onUpdate.dispatch(Radio.Events.QueueOption.ShuffleModeChanged)
}

var currentLoopMode = LoopMode.None
set(value) {
private set(value) {
field = value
symphony.radio.onUpdate.dispatch(Radio.Events.QueueOption.LoopModeChanged)
}

val currentSongId: String?
get() = getSongIdAt(currentSongIndex)
private get() = getSongIdAt(currentSongIndex)

fun hasSongAt(index: Int) = index > -1 && index < currentQueue.size
fun getSongIdAt(index: Int) = if (hasSongAt(index)) currentQueue[index] else null
Expand Down Expand Up @@ -136,7 +138,7 @@ class RadioQueue(private val symphony: Symphony) {
} else {
currentQueue.clear()
currentQueue.addAll(originalQueue)
currentQueue.indexOfFirst { it == currentSongId }
originalQueue.indexOfFirst { it == currentSongId }
}
}
symphony.radio.onUpdate.dispatch(Radio.Events.Queue.Modified)
Expand Down

0 comments on commit e4926b4

Please sign in to comment.