🐛 Fix videoData duration

This commit is contained in:
Androz2091 2020-11-01 17:09:44 +01:00
parent 269c2b49f6
commit 3db881f678
2 changed files with 3 additions and 3 deletions

View file

@ -166,7 +166,7 @@ class Player extends EventEmitter {
if (queryType === 'youtube-video-keywords') {
await ytsr.search(updatedQuery || query, { type: 'video' }).then((results) => {
if (results.length !== 0) {
tracks = results.map((r) => new Track(r, message.author, null))
tracks = results.map((r) => new Track(r, message.author, this))
}
}).catch(() => {})
}
@ -297,7 +297,7 @@ class Player extends EventEmitter {
title: item.title,
description: item.description,
views: item.views,
duration: item.duration,
durationFormatted: item.duration,
url: item.url,
thumbnail: item.thumbnail,
channel: {

View file

@ -31,7 +31,7 @@ class Track {
* The video duration (formatted).
* @type {string}
*/
this.duration = videoData.duration || videoData.durationFormatted
this.duration = videoData.durationFormatted
/**
* The video description
* @type {string}