mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-10-23 11:27:39 +00:00
Player/handleIntent: fix enqueue if player not running
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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user