fix(player): 修复歌曲时长过长时的进度显示问题 (#1936)

原先进度条遇到时长超过 1hr 的歌曲,
不会呈现小时数的部分。这个 commit
将歌曲时长小时数加到分钟数中。
This commit is contained in:
洩氏诹诹子 2023-04-08 23:16:01 +08:00 committed by GitHub
parent 65f5df8a60
commit b7f7ac8d31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -221,7 +221,7 @@ export function bytesToSize(bytes) {
export function formatTrackTime(value) {
if (!value) return '';
let min = ~~((value / 60) % 60);
let min = ~~(value / 60);
let sec = (~~(value % 60)).toString().padStart(2, '0');
return `${min}:${sec}`;
}