diff --git a/app/src/main/java/com/github/libretube/util/PlayingQueue.kt b/app/src/main/java/com/github/libretube/util/PlayingQueue.kt index 35f3c3436..31769d384 100644 --- a/app/src/main/java/com/github/libretube/util/PlayingQueue.kt +++ b/app/src/main/java/com/github/libretube/util/PlayingQueue.kt @@ -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) } }