diff --git a/src/commands/music/play.ts b/src/commands/music/play.ts index 9cbb3d2..68090c5 100644 --- a/src/commands/music/play.ts +++ b/src/commands/music/play.ts @@ -187,7 +187,18 @@ export default { return loc.get("c_play_sub2_name"); } - const estimation = timeToString(queue.estimatedDuration); + const estimation = timeToString( + [queue.currentTrack, ...queue.tracks.toArray()] + .filter((t) => t !== null) + .slice(0, pos) + .reduce((total, t) => { + if (total === 0) { + // TODO: First track, already playing, we have to substract the already elapsed time + return t.durationMS; + } + return total + t.durationMS; + }, 0), + ); return `${loc.get("c_play10")} ${pos} (${loc.get("c_play11")} ≈${estimation})`; };