mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-03 01:39:38 +02:00
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.
This commit is contained in:
parent
01f9a3de33
commit
d77771a60c
1 changed files with 10 additions and 2 deletions
|
@ -394,9 +394,13 @@ public final class Player implements PlaybackListener, Listener {
|
|||
return;
|
||||
}
|
||||
playQueue.append(newQueue.getStreams());
|
||||
}
|
||||
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) {
|
||||
final PlayQueue newQueue = getPlayQueueFromCache(intent);
|
||||
|
@ -405,9 +409,13 @@ public final class Player implements PlaybackListener, Listener {
|
|||
}
|
||||
final PlayQueueItem newItem = newQueue.getStreams().get(0);
|
||||
newQueue.enqueueNext(newItem, false);
|
||||
}
|
||||
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);
|
||||
assert dat != null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue