Merge pull request #800 from Tim-Kaiser/ISSUE/790
Closes #790 : Next cycles the play queue
This commit is contained in:
@@ -313,11 +313,13 @@ func (p *playbackEngine) SeekFwdBackN(n int) error {
|
||||
if n == 0 || (idx == 0 && n < 0) {
|
||||
return p.player.SeekSeconds(0) // seek back in current song
|
||||
}
|
||||
|
||||
lastIdx := len(p.playQueue) - 1
|
||||
if idx == lastIdx && n > 0 {
|
||||
return nil // already on last track, nothing to seek next to
|
||||
}
|
||||
newIdx := min(lastIdx, max(0, idx+n))
|
||||
|
||||
if idx == lastIdx && n > 0 {
|
||||
newIdx = 0
|
||||
}
|
||||
return p.PlayTrackAt(newIdx)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user