🐛 Fix fromPlaylist property

This commit is contained in:
Androz2091 2021-01-03 11:54:42 +01:00
parent 0a3a41ced2
commit daa3d023a6

View file

@ -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