🐛 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') { if (queryType === 'youtube-video-keywords') {
await ytsr.search(updatedQuery || query, { type: 'video' }).then((results) => { await ytsr.search(updatedQuery || query, { type: 'video' }).then((results) => {
if (results.length !== 0) { 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(() => {}) }).catch(() => {})
} }
@ -297,7 +297,7 @@ class Player extends EventEmitter {
title: item.title, title: item.title,
description: item.description, description: item.description,
views: item.views, views: item.views,
duration: item.duration, durationFormatted: item.duration,
url: item.url, url: item.url,
thumbnail: item.thumbnail, thumbnail: item.thumbnail,
channel: { channel: {

View file

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