From 60f818eddd67718e632aee8a740fc63c49dcf691 Mon Sep 17 00:00:00 2001 From: Michael Yaworski Date: Wed, 19 Jun 2024 00:18:54 -0400 Subject: [PATCH] [Player] Fixes duration bug for /play command A YouTube livestream which has duration 0 would show 0:00/0:00, which is meaningless. --- src/commands/player/play.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/player/play.ts b/src/commands/player/play.ts index a6b8b74..5e27e65 100644 --- a/src/commands/player/play.ts +++ b/src/commands/player/play.ts @@ -49,7 +49,7 @@ async function enqueue(session: Session, tracks: Track[], pushToFront: boolean): if (wasPlayingAnything) { return { description: `Queued at position #${pushToFront ? 1 : session.queue.length}: ${videoDetails.title}` }; } - const duration = videoDetails.duration != null ? getTrackDurationString(0, videoDetails.duration) : null; + const duration = videoDetails.duration ? getTrackDurationString(0, videoDetails.duration) : null; const speed = session.getPlaybackSpeed(); const footerText = getTrackDurationAndSpeed(duration, speed); return {