mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge pull request #2724 from Bnyro/master
Fix duplicated videos in the playing queue
This commit is contained in:
commit
69bdb2042b
@ -30,11 +30,11 @@ object PlayingQueue {
|
||||
fun clear() = queue.clear()
|
||||
|
||||
fun add(vararg streamItem: StreamItem) {
|
||||
streamItem.forEach {
|
||||
if (currentStream != it) {
|
||||
if (queue.contains(it)) queue.remove(it)
|
||||
queue.add(it)
|
||||
}
|
||||
for (stream in streamItem) {
|
||||
if (currentStream?.url?.toID() == stream.url?.toID()) continue
|
||||
// remove if already present
|
||||
queue.remove(stream)
|
||||
queue.add(stream)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user