From f4f9136956dafae071602bfdd8909240ef088409 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Thu, 13 May 2021 13:57:33 +0545 Subject: [PATCH] do not remove initial track from the playlist object --- src/Player.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index 10abc9e..d73eb6b 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -331,7 +331,7 @@ export class Player extends EventEmitter { const queue = this._addTracksToQueue(message, tracks); this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, pl); } else { - const track = tracks.shift(); + const track = tracks[0]; const queue = (await this._createQueue(message, track).catch( (e) => void this.emit(PlayerEvents.ERROR, e, message) )) as Queue; @@ -387,7 +387,7 @@ export class Player extends EventEmitter { const queue = this._addTracksToQueue(message, tracks); this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, playlist); } else { - const track = tracks.shift(); + const track = tracks[0]; const queue = (await this._createQueue(message, track).catch( (e) => void this.emit(PlayerEvents.ERROR, e, message) )) as Queue; @@ -442,7 +442,7 @@ export class Player extends EventEmitter { const queue = this._addTracksToQueue(message, res.tracks); this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, res); } else { - const track = res.tracks.shift(); + const track = res.tracks[0]; const queue = (await this._createQueue(message, track).catch( (e) => void this.emit(PlayerEvents.ERROR, e, message) )) as Queue;