From daa3d023a639d672623d2158e7595c2ddbf0eaa9 Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Sun, 3 Jan 2021 11:54:42 +0100 Subject: [PATCH] :bug: Fix fromPlaylist property --- src/Player.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Player.js b/src/Player.js index f338d2c..43a126a 100644 --- a/src/Player.js +++ b/src/Player.js @@ -315,7 +315,12 @@ class Player extends EventEmitter { async _handlePlaylist (message, query) { const playlist = await ytsr.getPlaylist(query) if (!playlist) return this.emit('noResults', message, query) - playlist.tracks = playlist.videos.map((item) => new Track(item, message.author)) + playlist.tracks = playlist.videos.map((item) => new Track({ + ...item, + ...{ + fromPlaylist: true + } + }, message.author)) playlist.duration = playlist.tracks.reduce((prev, next) => prev + next.duration, 0) playlist.thumbnail = playlist.tracks[0].thumbnail playlist.requestedBy = message.author