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", diff --git a/src/Player.ts b/src/Player.ts index 05c773c..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, @@ -331,7 +326,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 +382,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 +437,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;