diff options
Diffstat (limited to 'backend.js')
-rw-r--r-- | backend.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/backend.js b/backend.js index 36344be..59c4a48 100644 --- a/backend.js +++ b/backend.js @@ -338,9 +338,11 @@ class QueuePlayer extends EventEmitter { } } - shuffleQueue() { + shuffleQueue(pastPlayingTrackOnly = true) { const queue = this.queueGrouplike - const index = queue.items.indexOf(this.playingTrack) + 1 // This is 0 if no track is playing + const index = (pastPlayingTrackOnly + ? queue.items.indexOf(this.playingTrack) + 1 // This is 0 if no track is playing + : 0) const initialItems = queue.items.slice(0, index) const remainingItems = queue.items.slice(index) const newItems = initialItems.concat(shuffleArray(remainingItems)) @@ -517,8 +519,7 @@ class QueuePlayer extends EventEmitter { this.playFirst() return true case 'shuffle': - this.clearPlayingTrack() - this.shuffleQueue() + this.shuffleQueue(false) this.playFirst() return true case 'end': |