feat: P7 在线播放(播放队列、媒体控制)与自建歌单
- 播放器:统一 PlayItem 队列,顺序 / 列表循环 / 单曲循环 / 随机,滚动歌词含翻译,Media Session,队列与进度存 localStorage - 在线播放音质可在设置中选择;曲库已有的歌优先播放本地文件 - 自建歌单:混排在线曲目与本地文件,拖动排序,一键下载曲库缺失曲目 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,13 @@ export function formatDuration(ms?: number | null): string {
|
||||
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
/** 总时长:1 小时 12 分 / 38 分钟 */
|
||||
export function formatTotal(ms?: number | null): string {
|
||||
if (!ms) return '';
|
||||
const min = Math.round(ms / 60000);
|
||||
return min >= 60 ? `${Math.floor(min / 60)} 小时 ${min % 60} 分` : `${Math.max(1, min)} 分钟`;
|
||||
}
|
||||
|
||||
export function formatSeconds(sec: number): string {
|
||||
if (!Number.isFinite(sec)) return '0:00';
|
||||
const s = Math.floor(sec);
|
||||
|
||||
Reference in New Issue
Block a user