Skip to content

Commit 50e5ca1

Browse files
committed
Player: remove unused REPEAT_MODE intent key
1 parent f06d960 commit 50e5ca1

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
@@ -152,7 +152,6 @@ public final class Player implements PlaybackListener, Listener {
152152
// Intent
153153
//////////////////////////////////////////////////////////////////////////*/
154154

155-
public static final String REPEAT_MODE = "repeat_mode";
156155
public static final String PLAYBACK_QUALITY = "playback_quality";
157156
public static final String PLAY_QUEUE_KEY = "play_queue_key";
158157
public static final String RESUME_PLAYBACK = "resume_playback";
@@ -383,7 +382,6 @@ public void handleIntent(@NonNull final Intent intent) {
383382
final float playbackPitch = savedParameters.pitch;
384383
final boolean playbackSkipSilence = getPrefs().getBoolean(getContext().getString(
385384
R.string.playback_skip_silence_key), getPlaybackSkipSilence());
386-
final int repeatMode = intent.getIntExtra(REPEAT_MODE, getRepeatMode());
387385
final boolean playWhenReady = intent.getBooleanExtra(PLAY_WHEN_READY, true);
388386

389387
// branching parameters for below
@@ -445,27 +443,27 @@ public void handleIntent(@NonNull final Intent intent) {
445443
newQueue.setRecovery(newQueue.getIndex(),
446444
state.getProgressMillis());
447445
}
448-
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
446+
initPlayback(newQueue, playbackSpeed, playbackPitch,
449447
playbackSkipSilence, playWhenReady);
450448
},
451449
error -> {
452450
if (DEBUG) {
453451
Log.w(TAG, "Failed to start playback", error);
454452
}
455453
// In case any error we can start playback without history
456-
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
454+
initPlayback(newQueue, playbackSpeed, playbackPitch,
457455
playbackSkipSilence, playWhenReady);
458456
},
459457
() -> {
460458
// Completed but not found in history
461-
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
459+
initPlayback(newQueue, playbackSpeed, playbackPitch,
462460
playbackSkipSilence, playWhenReady);
463461
}
464462
));
465463
} else {
466464
// Good to go...
467465
// In a case of equal PlayQueues we can re-init old one but only when it is disposed
468-
initPlayback(samePlayQueue ? playQueue : newQueue, repeatMode, playbackSpeed,
466+
initPlayback(samePlayQueue ? playQueue : newQueue, playbackSpeed,
469467
playbackPitch, playbackSkipSilence, playWhenReady);
470468
}
471469

@@ -512,14 +510,12 @@ private void initUIsForCurrentPlayerType() {
512510
}
513511

514512
private void initPlayback(@NonNull final PlayQueue queue,
515-
@RepeatMode final int repeatMode,
516513
final float playbackSpeed,
517514
final float playbackPitch,
518515
final boolean playbackSkipSilence,
519516
final boolean playOnReady) {
520517
destroyPlayer();
521518
initPlayer(playOnReady);
522-
setRepeatMode(repeatMode);
523519
setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence);
524520

525521
playQueue = queue;

0 commit comments

Comments
 (0)