From 3db881f6781b4f4ee0fd291c0ee5bad9719ae273 Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Sun, 1 Nov 2020 17:09:44 +0100 Subject: [PATCH] :bug: Fix videoData duration --- src/Player.js | 4 ++-- src/Track.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player.js b/src/Player.js index 69ed5f7..8db56cf 100644 --- a/src/Player.js +++ b/src/Player.js @@ -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: { diff --git a/src/Track.js b/src/Track.js index f76b38a..39e815d 100644 --- a/src/Track.js +++ b/src/Track.js @@ -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}