chore: merge branch dev to main #200

Merged
Anri merged 19 commits from dev into main 2024-11-02 17:36:38 +01:00
Showing only changes of commit ae6e6960e0 - Show all commits

View file

@ -187,7 +187,18 @@ export default {
return loc.get("c_play_sub2_name"); 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})`; return `${loc.get("c_play10")} ${pos} (${loc.get("c_play11")}${estimation})`;
}; };