From 5497407c58b7e2f9f6be977995b705a53c537a14 Mon Sep 17 00:00:00 2001 From: shinya Date: Wed, 30 Jul 2025 22:01:49 +0800 Subject: [PATCH] feat: set outroTime negative time --- VERSION.txt | 2 +- src/app/play/page.tsx | 21 +++++++++++++-------- src/lib/version.ts | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 9544124..cbeaa0a 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -20250730215517 \ No newline at end of file +20250730220149 \ No newline at end of file diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index 0dd4d6c..237e4ad 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -1318,18 +1318,22 @@ function PlayPageClient() { html: '设置片尾', icon: '', tooltip: - skipConfig.outro_time === 0 + skipConfig.outro_time >= 0 ? '设置片尾时间' - : `${formatTime(skipConfig.outro_time)}`, + : `-${formatTime(-skipConfig.outro_time)}`, onClick: function () { - const currentTime = artPlayerRef.current?.currentTime || 0; - if (currentTime > 0) { + const outroTime = + -( + artPlayerRef.current?.duration - + artPlayerRef.current?.currentTime + ) || 0; + if (outroTime < 0) { const newConfig = { ...skipConfig, - outro_time: currentTime, + outro_time: outroTime, }; handleSkipConfigChange(newConfig); - return `${formatTime(currentTime)}`; + return `-${formatTime(-outroTime)}`; } }, }, @@ -1424,9 +1428,10 @@ function PlayPageClient() { // 跳过片尾 if ( - skipConfigRef.current.outro_time > 0 && + skipConfigRef.current.outro_time < 0 && duration > 0 && - currentTime > skipConfigRef.current.outro_time + currentTime > + artPlayerRef.current.duration + skipConfigRef.current.outro_time ) { if ( currentEpisodeIndexRef.current < diff --git a/src/lib/version.ts b/src/lib/version.ts index f8b7a48..4a4a564 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -2,7 +2,7 @@ 'use client'; -const CURRENT_VERSION = '20250730215517'; +const CURRENT_VERSION = '20250730220149'; // 版本检查结果枚举 export enum UpdateStatus {