From 5bbb0cd666a843c25ad5ec4a44aaa7db700262b7 Mon Sep 17 00:00:00 2001 From: shivanju Date: Sat, 24 Nov 2018 17:20:57 +0530 Subject: [PATCH] issue:1336 Remove auto queued stream if a new stream gets appended --- .../java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 13a550f2e..2a7c9f127 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -234,10 +234,9 @@ public abstract class PlayQueue implements Serializable { Collections.shuffle(itemList); } if (!streams.isEmpty() && streams.get(streams.size() - 1).isAutoQueued() && !itemList.get(0).isAutoQueued()) { - streams.addAll(streams.size() - 1, itemList); - } else { - streams.addAll(itemList); + streams.remove(streams.size() - 1); } + streams.addAll(itemList); broadcast(new AppendEvent(itemList.size())); }