Skip to content

Commit

Permalink
[Player] Fixes duration bug for /play command
Browse files Browse the repository at this point in the history
A YouTube livestream which has duration 0 would show 0:00/0:00,
which is meaningless.
  • Loading branch information
mikeyaworski committed Jun 19, 2024
1 parent f54accf commit 60f818e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/player/play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 60f818e

Please sign in to comment.