Skip to content

Commit

Permalink
rewind song even when not playing
Browse files Browse the repository at this point in the history
Fixes issue vanilla-music#1121
  • Loading branch information
adrian-bl committed Jan 7, 2023
1 parent 2ce77f3 commit db6e8fb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1753,13 +1753,14 @@ public Song shiftCurrentSong(int delta)
}

/**
* Skips to the previous song OR rewinds the currently playing track
* Skips to the previous song OR rewinds the currently playing track, depending
* on the current position.
*
* @return The new current song
*/
public Song rewindCurrentSong() {
int delta = SongTimeline.SHIFT_PREVIOUS_SONG;
if(isPlaying() && getPosition() > REWIND_AFTER_PLAYED_MS && getDuration() > REWIND_AFTER_PLAYED_MS*2) {
if(getPosition() > REWIND_AFTER_PLAYED_MS && getDuration() > REWIND_AFTER_PLAYED_MS*2) {
delta = SongTimeline.SHIFT_KEEP_SONG;
}
return shiftCurrentSong(delta);
Expand Down

0 comments on commit db6e8fb

Please sign in to comment.