From d77771a60c85869b17a6b5c25ca3f0ebb5a58574 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 5 Sep 2025 19:02:04 +0200 Subject: [PATCH] Player/handleIntent: fix enqueue if player not running MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 063dcd41e57c46721f1691cd57d21fbde75a35ea I falsely claimed that the fallthrough case is always degenerate, but it kinda somehow still worked because if you long-click on e.g. the popup button, it would call enqueue, but if nothing was running yet it would fallthrough to the very last case and start the player with the video. So let’s return to that and add a TODO for further refactoring in the future. --- .../main/java/org/schabi/newpipe/player/Player.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index ee4081068..1664dc0e3 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -394,8 +394,12 @@ public final class Player implements PlaybackListener, Listener { return; } playQueue.append(newQueue.getStreams()); + return; } - return; + + // TODO: This falls through to the old logic, there was no playQueue + // yet so we should start the player and add the new video + break; } case EnqueueNext -> { if (playQueue != null) { @@ -405,8 +409,12 @@ public final class Player implements PlaybackListener, Listener { } final PlayQueueItem newItem = newQueue.getStreams().get(0); newQueue.enqueueNext(newItem, false); + return; } - return; + + // TODO: This falls through to the old logic, there was no playQueue + // yet so we should start the player and add the new video + break; } case TimestampChange -> { final TimestampChangeData dat = intent.getParcelableExtra(PLAYER_INTENT_DATA);