Skip to content

Add 'Stop after current song' playback option - #13747

Open
mmustafasenoglu wants to merge 2 commits into
TeamNewPipe:devfrom
mmustafasenoglu:feature/stop-after-current-song
Open

Add 'Stop after current song' playback option#13747
mmustafasenoglu wants to merge 2 commits into
TeamNewPipe:devfrom
mmustafasenoglu:feature/stop-after-current-song

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

What is it?

  • Feature (user facing)

Description of the changes in your PR

Adds a fourth repeat mode cycle state that stops playback after the current song ends while keeping the queue intact.

The repeat button now cycles through:

  1. No repeat (REPEAT_MODE_OFF)
  2. Repeat one (REPEAT_MODE_ONE)
  3. Repeat all (REPEAT_MODE_ALL)
  4. Stop after current song (new custom state)

When 'stop after current song' is active:

  • The repeat button shows a half-transparent repeat_one icon to distinguish from normal repeat-one
  • Playback stops when the current track transitions to the next
  • The queue remains intact for later continuation
  • The mode automatically resets when the track ends

Implementation details

  • Added stopAfterCurrentSong boolean field in Player.java
  • Added isStopAfterCurrentSong() getter and onStopAfterCurrentSongChanged() callback
  • Modified cycleNextRepeatMode() to include the 4th state (cycles: OFF -> ONE -> ALL -> STOP_CURRENT -> OFF)
  • Updated VideoPlayerUi, PlayQueueActivity, NotificationPlayerUi, MediaSessionPlayerUi, and NotificationActionData to handle the new mode
  • Added string resource notification_action_stop_after_current

Fixes the following issue(s)

Due diligence

Adds a fourth repeat mode cycle state that stops playback after the
current song ends while keeping the queue intact.

The repeat button now cycles through:
1. No repeat (REPEAT_MODE_OFF)
2. Repeat one (REPEAT_MODE_ONE)
3. Repeat all (REPEAT_MODE_ALL)
4. Stop after current song (custom state using REPEAT_MODE_OFF internally)

When 'stop after current song' is active:
- The repeat button shows a half-transparent repeat_one icon
- Playback stops when the current track transitions to the next
- The queue remains intact for later continuation
- The mode automatically resets when the track ends

Implementation:
- Added stopAfterCurrentSong boolean field in Player
- Added isStopAfterCurrentSong() getter
- Modified cycleNextRepeatMode() to include the 4th state
- Added onStopAfterCurrentSongChanged() callback in PlayerUi
- Updated VideoPlayerUi, PlayQueueActivity, NotificationPlayerUi,
  MediaSessionPlayerUi, and NotificationActionData to handle the new mode
- Added notification string resource for the new mode

Fixes TeamNewPipe#12726
Copilot AI lite review requested due to automatic review settings August 5, 2026 21:56

This comment was marked as spam.

@github-actions github-actions Bot added the size/medium PRs with less than 250 changed lines label Aug 5, 2026
@TobiGr TobiGr added GUI Issue is related to the graphical user interface player Issues related to any player (main, popup and background) feature request Issue is related to a feature in the app labels Aug 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@TobiGr TobiGr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. Please add a screen recording showcasing the new behaviour on phone and tablets.

<string name="notification_actions_summary_android13">Edit each notification action below by tapping on it. The first three actions (play/pause, previous and next) are set by the system and cannot be customized.</string>
<string name="notification_actions_at_most_three">You can select at most three actions to show in the compact notification!</string>
<string name="notification_action_repeat">Repeat</string>
<string name="notification_action_stop_after_current">Stop after current song</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<string name="notification_action_stop_after_current">Stop after current song</string>
<string name="notification_action_stop_after_current">Stop after current stream</string>

// minimized to background but will resume automatically to the original player type
private boolean isAudioOnly = false;
private boolean isPrepared = false;
private boolean stopAfterCurrentSong = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the term stream because NewPipe can play both video and audio and NewPipe is not a music pkayer. Plesse use it throughout the whole PR.

@TobiGr TobiGr added the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface player Issues related to any player (main, popup and background) size/medium PRs with less than 250 changed lines waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Stop after current song ends" playback option

3 participants