mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Fix duplicated videos in the playing queue
This commit is contained in:
parent
aa3aee0b27
commit
bda610d99c
@ -30,11 +30,11 @@ object PlayingQueue {
|
|||||||
fun clear() = queue.clear()
|
fun clear() = queue.clear()
|
||||||
|
|
||||||
fun add(vararg streamItem: StreamItem) {
|
fun add(vararg streamItem: StreamItem) {
|
||||||
streamItem.forEach {
|
for (stream in streamItem) {
|
||||||
if (currentStream != it) {
|
if (currentStream?.url?.toID() == stream.url?.toID()) continue
|
||||||
if (queue.contains(it)) queue.remove(it)
|
// remove if already present
|
||||||
queue.add(it)
|
queue.remove(stream)
|
||||||
}
|
queue.add(stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user