mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Respect queue settings when using player controls
This commit is contained in:
parent
d96acd85fc
commit
dfef007bd9
@ -42,18 +42,17 @@ object PlayingQueue {
|
||||
)
|
||||
}
|
||||
|
||||
// return the next item, or if repeating enabled, the first one of the queue
|
||||
fun getNext(): String? = queue.getOrNull(currentIndex() + 1)?.url?.toID()
|
||||
?: queue.firstOrNull()?.url?.toID()?.takeIf { repeatQueue }
|
||||
|
||||
// return the previous item, or if repeating enabled, the last one of the queue
|
||||
fun getPrev(): String? = queue.getOrNull(currentIndex() - 1)?.url?.toID()
|
||||
?: queue.lastOrNull()?.url?.toID()?.takeIf { repeatQueue }
|
||||
|
||||
fun hasPrev(): Boolean {
|
||||
return currentIndex() > 0
|
||||
}
|
||||
fun hasPrev() = getPrev() != null
|
||||
|
||||
fun hasNext(): Boolean {
|
||||
return currentIndex() + 1 < size()
|
||||
}
|
||||
fun hasNext() = getNext() != null
|
||||
|
||||
fun updateCurrent(streamItem: StreamItem) {
|
||||
currentStream = streamItem
|
||||
|
Loading…
x
Reference in New Issue
Block a user