From 305a767896ecc2b339d85d4b37c068b085e73ccb Mon Sep 17 00:00:00 2001 From: anglesgirl Date: Sun, 12 Jul 2026 05:06:24 +0000 Subject: [PATCH] fix: skip 'last played' prompt for duanju (short drama) Short drama episodes are typically 60-120 seconds, making the 'last played at XX:XX' resume prompt unnecessary and annoying. This change: - Add isDuanju prop to VideoCard, passed as &duanju=1 URL parameter - duanju page passes isDuanju to VideoCard - play page checks duanju=1 param and skips the resume prompt entirely --- src/app/duanju/page.tsx | 1 + src/app/play/page.tsx | 6 ++++++ src/components/VideoCard.tsx | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/duanju/page.tsx b/src/app/duanju/page.tsx index 317638c..edd8b5f 100644 --- a/src/app/duanju/page.tsx +++ b/src/app/duanju/page.tsx @@ -244,6 +244,7 @@ function DuanjuPageClient() { year={item.year} from='source-search' type='tv' + isDuanju cmsData={{ desc: item.desc, episodes: item.episodes, diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index 6763977..c0049f0 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -8736,6 +8736,12 @@ function PlayPageClient() { // 条件:当前播放时间 < 10秒 且 播放记录时间 > 10秒 const checkPlayRecordJump = async () => { try { + // 短剧不显示"上次播放到"提示(短剧单集太短,提示意义不大) + if (searchParams.get('duanju') === '1') { + playRecordJumpInitialCheckRef.current = false; + return; + } + // 仅在进入播放后的首次检查时处理,避免本次会话新生成的记录触发恢复按钮 if (!playRecordJumpInitialCheckRef.current) { return; diff --git a/src/components/VideoCard.tsx b/src/components/VideoCard.tsx index de7b594..a275b30 100644 --- a/src/components/VideoCard.tsx +++ b/src/components/VideoCard.tsx @@ -94,6 +94,7 @@ export interface VideoCardProps { episodes_titles?: string[]; }; onBeforeNavigate?: () => void; + isDuanju?: boolean; // 短剧标识,用于播放页跳过"上次播放到"提示 } export type VideoCardHandle = { @@ -134,6 +135,7 @@ const VideoCard = forwardRef( totalTime, cmsData, onBeforeNavigate, + isDuanju, }: VideoCardProps, ref ) { @@ -447,7 +449,7 @@ const VideoCard = forwardRef( isAggregate ? '&prefer=true' : '' }${ actualQuery ? `&stitle=${encodeURIComponent(actualQuery.trim())}` : '' - }${actualSearchType ? `&stype=${actualSearchType}` : ''}`; + }${actualSearchType ? `&stype=${actualSearchType}` : ''}${isDuanju ? '&duanju=1' : ''}`; if (isCurrentlyOnPlayPage) { // 在 play 页面内,添加 _reload 参数强制刷新 @@ -471,6 +473,7 @@ const VideoCard = forwardRef( actualQuery, actualSearchType, onBeforeNavigate, + isDuanju, ]); // 新标签页播放处理函数 @@ -509,7 +512,7 @@ const VideoCard = forwardRef( isAggregate ? '&prefer=true' : '' }${ actualQuery ? `&stitle=${encodeURIComponent(actualQuery.trim())}` : '' - }${actualSearchType ? `&stype=${actualSearchType}` : ''}`; + }${actualSearchType ? `&stype=${actualSearchType}` : ''}${isDuanju ? '&duanju=1' : ''}`; window.open(url, '_blank'); } }, [ @@ -524,6 +527,7 @@ const VideoCard = forwardRef( actualQuery, actualSearchType, onBeforeNavigate, + isDuanju, ]); // 检查搜索结果的收藏状态