Skip to content

Commit 519d1a5

Browse files
committed
Player: remove unused REPEAT_MODE intent key
1 parent 960a5cb commit 519d1a5

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public final class Player implements PlaybackListener, Listener {
154154
// Intent
155155
//////////////////////////////////////////////////////////////////////////*/
156156

157-
public static final String REPEAT_MODE = "repeat_mode";
158157
public static final String PLAYBACK_QUALITY = "playback_quality";
159158
public static final String PLAY_QUEUE_KEY = "play_queue_key";
160159
public static final String RESUME_PLAYBACK = "resume_playback";
@@ -394,7 +393,6 @@ public void handleIntent(@NonNull final Intent intent) {
394393
final float playbackPitch = savedParameters.pitch;
395394
final boolean playbackSkipSilence = getPrefs().getBoolean(getContext().getString(
396395
R.string.playback_skip_silence_key), getPlaybackSkipSilence());
397-
final int repeatMode = intent.getIntExtra(REPEAT_MODE, getRepeatMode());
398396
final boolean playWhenReady = intent.getBooleanExtra(PLAY_WHEN_READY, true);
399397

400398
// branching parameters for below
@@ -456,27 +454,27 @@ public void handleIntent(@NonNull final Intent intent) {
456454
newQueue.setRecovery(newQueue.getIndex(),
457455
state.getProgressMillis());
458456
}
459-
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
457+
initPlayback(newQueue, playbackSpeed, playbackPitch,
460458
playbackSkipSilence, playWhenReady);
461459
},
462460
error -> {
463461
if (DEBUG) {
464462
Log.w(TAG, "Failed to start playback", error);
465463
}
466464
// In case any error we can start playback without history
467-
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
465+
initPlayback(newQueue, playbackSpeed, playbackPitch,
468466
playbackSkipSilence, playWhenReady);
469467
},
470468
() -> {
471469
// Completed but not found in history
472-
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
470+
initPlayback(newQueue, playbackSpeed, playbackPitch,
473471
playbackSkipSilence, playWhenReady);
474472
}
475473
));
476474
} else {
477475
// Good to go...
478476
// In a case of equal PlayQueues we can re-init old one but only when it is disposed
479-
initPlayback(samePlayQueue ? playQueue : newQueue, repeatMode, playbackSpeed,
477+
initPlayback(samePlayQueue ? playQueue : newQueue, playbackSpeed,
480478
playbackPitch, playbackSkipSilence, playWhenReady);
481479
}
482480

@@ -523,14 +521,12 @@ private void initUIsForCurrentPlayerType() {
523521
}
524522

525523
private void initPlayback(@NonNull final PlayQueue queue,
526-
@RepeatMode final int repeatMode,
527524
final float playbackSpeed,
528525
final float playbackPitch,
529526
final boolean playbackSkipSilence,
530527
final boolean playOnReady) {
531528
destroyPlayer();
532529
initPlayer(playOnReady);
533-
setRepeatMode(repeatMode);
534530
setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence);
535531

536532
playQueue = queue;

0 commit comments

Comments
 (0)