kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Player/handleIntent: fix enqueue if player not running
In 063dcd41e5
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.
pull/12252/head
rodzic
01f9a3de33
commit
d77771a60c
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue