From 4face50dd670c4bcaecfd2fe01ccf308f719b8a4 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Thu, 13 May 2021 21:56:20 +0545 Subject: [PATCH 1/3] revert playlistAdd update --- src/Player.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index 05c773c..5aecb9d 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[0]; + const track = tracks.shift(); 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[0]; + const track = tracks.shift(); 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[0]; + const track = res.tracks.shift(); const queue = (await this._createQueue(message, track).catch( (e) => void this.emit(PlayerEvents.ERROR, e, message) )) as Queue; From 1eb2aa56955e1f945dc99cca185fbdca78e6bffe Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Thu, 13 May 2021 22:09:09 +0545 Subject: [PATCH 2/3] fix spotify thumbnails bug --- src/Player.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index 5aecb9d..97837d3 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -244,9 +244,7 @@ export class Player extends EventEmitter { author: m.artists[0]?.name ?? 'Unknown Artist', url: m.external_urls?.spotify ?? query, thumbnail: - playlist.images[0]?.url ?? m.preview_url?.length - ? `https://i.scdn.co/image/${m.preview_url?.split('?cid=')[1]}` - : 'https://www.scdn.co/i/_global/twitter_card-default.jpg', + playlist.images[0]?.url ?? 'https://www.scdn.co/i/_global/twitter_card-default.jpg', duration: Util.buildTimeCode(Util.parseMS(m.duration_ms)), views: 0, requestedBy: message.author, @@ -282,10 +280,7 @@ export class Player extends EventEmitter { description: m.track.description ?? '', author: m.track.artists[0]?.name ?? 'Unknown Artist', url: m.track.external_urls?.spotify ?? query, - thumbnail: - playlist.images[0]?.url ?? m.track.preview_url?.length - ? `https://i.scdn.co/image/${m.track.preview_url?.split('?cid=')[1]}` - : 'https://www.scdn.co/i/_global/twitter_card-default.jpg', + thumbnail: m.track.album?.images[0]?.url ?? 'https://www.scdn.co/i/_global/twitter_card-default.jpg', duration: Util.buildTimeCode(Util.parseMS(m.track.duration_ms)), views: 0, requestedBy: message.author, From f02422366ca224504b72394abd30fbd17201e90d Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Thu, 13 May 2021 22:09:55 +0545 Subject: [PATCH 3/3] v4.0.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64a3309..4737441 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-player", - "version": "4.0.8", + "version": "4.0.9", "description": "Complete framework to facilitate music commands using discord.js", "main": "lib/index.js", "types": "lib/index.d.ts",