better approx
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 21s
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 21s
This commit is contained in:
parent
5c5d35d5ca
commit
ae6e6960e0
1 changed files with 12 additions and 1 deletions
|
@ -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})`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue