🐛 Fix fromPlaylist property
This commit is contained in:
parent
0a3a41ced2
commit
daa3d023a6
1 changed files with 6 additions and 1 deletions
|
@ -315,7 +315,12 @@ class Player extends EventEmitter {
|
||||||
async _handlePlaylist (message, query) {
|
async _handlePlaylist (message, query) {
|
||||||
const playlist = await ytsr.getPlaylist(query)
|
const playlist = await ytsr.getPlaylist(query)
|
||||||
if (!playlist) return this.emit('noResults', message, 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.duration = playlist.tracks.reduce((prev, next) => prev + next.duration, 0)
|
||||||
playlist.thumbnail = playlist.tracks[0].thumbnail
|
playlist.thumbnail = playlist.tracks[0].thumbnail
|
||||||
playlist.requestedBy = message.author
|
playlist.requestedBy = message.author
|
||||||
|
|
Loading…
Reference in a new issue