From e4926b479376b48266da0e16c933828f17b9a481 Mon Sep 17 00:00:00 2001 From: Zyrouge Date: Sat, 7 Dec 2024 13:33:26 +0530 Subject: [PATCH] chore: lint --- .../zyrouge/symphony/services/radio/RadioQueue.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/github/zyrouge/symphony/services/radio/RadioQueue.kt b/app/src/main/java/io/github/zyrouge/symphony/services/radio/RadioQueue.kt index f903b6e2..be019d33 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/services/radio/RadioQueue.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/services/radio/RadioQueue.kt @@ -15,28 +15,30 @@ class RadioQueue(private val symphony: Symphony) { } val originalQueue = ConcurrentList() + private set val currentQueue = ConcurrentList() + 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 @@ -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)