diff --git a/VERSION.txt b/VERSION.txt index df38e6b..ed32003 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -20250729213020 \ No newline at end of file +20250730014453 \ No newline at end of file diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index cf75288..83df039 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -72,6 +72,9 @@ function PlayPageClient() { skipConfig.outro_time, ]); + // 跳过检查的时间间隔控制 + const lastSkipCheckRef = useRef(0); + // 去广告开关(从 localStorage 继承,默认 true) const [blockAdEnabled, setBlockAdEnabled] = useState(() => { if (typeof window !== 'undefined') { @@ -473,13 +476,23 @@ function PlayPageClient() { }; const formatTime = (seconds: number): string => { - if (seconds === 0) return '0秒'; - const minutes = Math.floor(seconds / 60); + if (seconds === 0) return '00:00'; + + const hours = Math.floor(seconds / 3600); + const minutes = Math.floor((seconds % 3600) / 60); const remainingSeconds = Math.round(seconds % 60); - if (minutes === 0) { - return `${remainingSeconds}秒`; + + if (hours === 0) { + // 不到一小时,格式为 00:00 + return `${minutes.toString().padStart(2, '0')}:${remainingSeconds + .toString() + .padStart(2, '0')}`; + } else { + // 超过一小时,格式为 00:00:00 + return `${hours.toString().padStart(2, '0')}:${minutes + .toString() + .padStart(2, '0')}:${remainingSeconds.toString().padStart(2, '0')}`; } - return `${minutes}分${remainingSeconds.toString().padStart(2, '0')}秒`; }; class CustomHlsJsLoader extends Hls.DefaultConfig.loader { @@ -1379,6 +1392,11 @@ function PlayPageClient() { const currentTime = artPlayerRef.current.currentTime || 0; const duration = artPlayerRef.current.duration || 0; + const now = Date.now(); + + // 限制跳过检查频率为1.5秒一次 + if (now - lastSkipCheckRef.current < 1500) return; + lastSkipCheckRef.current = now; // 跳过片头 if ( diff --git a/src/lib/version.ts b/src/lib/version.ts index 8a61b86..8ccdc2d 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -2,7 +2,7 @@ 'use client'; -const CURRENT_VERSION = '20250729213020'; +const CURRENT_VERSION = '20250730014453'; // 版本检查结果枚举 export enum UpdateStatus {