1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-06-26 23:22:52 +00:00

Player: remove unused REPEAT_MODE intent key

This commit is contained in:
Profpatsch 2025-05-05 15:33:20 +02:00
parent 960a5cb2cf
commit 519d1a5e03

View File

@ -154,7 +154,6 @@ public final class Player implements PlaybackListener, Listener {
// Intent // Intent
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
public static final String REPEAT_MODE = "repeat_mode";
public static final String PLAYBACK_QUALITY = "playback_quality"; public static final String PLAYBACK_QUALITY = "playback_quality";
public static final String PLAY_QUEUE_KEY = "play_queue_key"; public static final String PLAY_QUEUE_KEY = "play_queue_key";
public static final String RESUME_PLAYBACK = "resume_playback"; public static final String RESUME_PLAYBACK = "resume_playback";
@ -394,7 +393,6 @@ public final class Player implements PlaybackListener, Listener {
final float playbackPitch = savedParameters.pitch; final float playbackPitch = savedParameters.pitch;
final boolean playbackSkipSilence = getPrefs().getBoolean(getContext().getString( final boolean playbackSkipSilence = getPrefs().getBoolean(getContext().getString(
R.string.playback_skip_silence_key), getPlaybackSkipSilence()); R.string.playback_skip_silence_key), getPlaybackSkipSilence());
final int repeatMode = intent.getIntExtra(REPEAT_MODE, getRepeatMode());
final boolean playWhenReady = intent.getBooleanExtra(PLAY_WHEN_READY, true); final boolean playWhenReady = intent.getBooleanExtra(PLAY_WHEN_READY, true);
// branching parameters for below // branching parameters for below
@ -456,7 +454,7 @@ public final class Player implements PlaybackListener, Listener {
newQueue.setRecovery(newQueue.getIndex(), newQueue.setRecovery(newQueue.getIndex(),
state.getProgressMillis()); state.getProgressMillis());
} }
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch, initPlayback(newQueue, playbackSpeed, playbackPitch,
playbackSkipSilence, playWhenReady); playbackSkipSilence, playWhenReady);
}, },
error -> { error -> {
@ -464,19 +462,19 @@ public final class Player implements PlaybackListener, Listener {
Log.w(TAG, "Failed to start playback", error); Log.w(TAG, "Failed to start playback", error);
} }
// In case any error we can start playback without history // In case any error we can start playback without history
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch, initPlayback(newQueue, playbackSpeed, playbackPitch,
playbackSkipSilence, playWhenReady); playbackSkipSilence, playWhenReady);
}, },
() -> { () -> {
// Completed but not found in history // Completed but not found in history
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch, initPlayback(newQueue, playbackSpeed, playbackPitch,
playbackSkipSilence, playWhenReady); playbackSkipSilence, playWhenReady);
} }
)); ));
} else { } else {
// Good to go... // Good to go...
// In a case of equal PlayQueues we can re-init old one but only when it is disposed // In a case of equal PlayQueues we can re-init old one but only when it is disposed
initPlayback(samePlayQueue ? playQueue : newQueue, repeatMode, playbackSpeed, initPlayback(samePlayQueue ? playQueue : newQueue, playbackSpeed,
playbackPitch, playbackSkipSilence, playWhenReady); playbackPitch, playbackSkipSilence, playWhenReady);
} }
@ -523,14 +521,12 @@ public final class Player implements PlaybackListener, Listener {
} }
private void initPlayback(@NonNull final PlayQueue queue, private void initPlayback(@NonNull final PlayQueue queue,
@RepeatMode final int repeatMode,
final float playbackSpeed, final float playbackSpeed,
final float playbackPitch, final float playbackPitch,
final boolean playbackSkipSilence, final boolean playbackSkipSilence,
final boolean playOnReady) { final boolean playOnReady) {
destroyPlayer(); destroyPlayer();
initPlayer(playOnReady); initPlayer(playOnReady);
setRepeatMode(repeatMode);
setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence); setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence);
playQueue = queue; playQueue = queue;