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
This commit is contained in:
anglesgirl
2026-07-12 05:06:24 +00:00
parent d682cee427
commit 305a767896
3 changed files with 13 additions and 2 deletions
+1
View File
@@ -244,6 +244,7 @@ function DuanjuPageClient() {
year={item.year}
from='source-search'
type='tv'
isDuanju
cmsData={{
desc: item.desc,
episodes: item.episodes,
+6
View File
@@ -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;
+6 -2
View File
@@ -94,6 +94,7 @@ export interface VideoCardProps {
episodes_titles?: string[];
};
onBeforeNavigate?: () => void;
isDuanju?: boolean; // 短剧标识,用于播放页跳过"上次播放到"提示
}
export type VideoCardHandle = {
@@ -134,6 +135,7 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(
totalTime,
cmsData,
onBeforeNavigate,
isDuanju,
}: VideoCardProps,
ref
) {
@@ -447,7 +449,7 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(
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<VideoCardHandle, VideoCardProps>(
actualQuery,
actualSearchType,
onBeforeNavigate,
isDuanju,
]);
// 新标签页播放处理函数
@@ -509,7 +512,7 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(
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<VideoCardHandle, VideoCardProps>(
actualQuery,
actualSearchType,
onBeforeNavigate,
isDuanju,
]);
// 检查搜索结果的收藏状态