修正小雅纠错不更新详情
This commit is contained in:
+13
-20
@@ -3928,28 +3928,21 @@ function PlayPageClient() {
|
|||||||
if (correction) {
|
if (correction) {
|
||||||
console.log('应用纠错信息:', correction);
|
console.log('应用纠错信息:', correction);
|
||||||
|
|
||||||
// 只更新显示相关的状态,不更新 detail(避免触发播放器刷新)
|
// 应用纠错信息到 detail
|
||||||
if (correction.title) {
|
const updatedDetail = applyCorrection(detail, correction);
|
||||||
setVideoTitle(correction.title);
|
|
||||||
}
|
// 更新所有相关状态
|
||||||
if (correction.posterPath) {
|
setDetail(updatedDetail);
|
||||||
// 补全 TMDB 图片 URL
|
setVideoTitle(updatedDetail.title);
|
||||||
const fullPosterUrl = getTMDBImageUrl(correction.posterPath);
|
setVideoCover(updatedDetail.poster);
|
||||||
setVideoCover(fullPosterUrl);
|
if (updatedDetail.douban_id) {
|
||||||
}
|
setVideoDoubanId(updatedDetail.douban_id);
|
||||||
if (correction.doubanId) {
|
|
||||||
const doubanIdNum = typeof correction.doubanId === 'string'
|
|
||||||
? parseInt(correction.doubanId, 10)
|
|
||||||
: correction.doubanId;
|
|
||||||
setVideoDoubanId(doubanIdNum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新 detailRef,这样其他地方使用 detailRef 时能获取到最新信息
|
// 更新 detailRef
|
||||||
if (detailRef.current) {
|
detailRef.current = updatedDetail;
|
||||||
detailRef.current = applyCorrection(detailRef.current, correction);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('已应用纠错信息(页面刷新后将完全生效)');
|
console.log('已应用纠错信息到当前视频详情:', updatedDetail);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5964,7 +5957,7 @@ function PlayPageClient() {
|
|||||||
|
|
||||||
// 调用异步初始化函数
|
// 调用异步初始化函数
|
||||||
initPlayer();
|
initPlayer();
|
||||||
}, [videoUrl, loading, blockAdEnabled, currentEpisodeIndex, detail]);
|
}, [videoUrl, loading, blockAdEnabled, currentEpisodeIndex, detail?.subtitles]);
|
||||||
|
|
||||||
// 当组件卸载时清理定时器、Wake Lock 和播放器资源
|
// 当组件卸载时清理定时器、Wake Lock 和播放器资源
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ const EpisodeSelector: React.FC<EpisodeSelectorProps> = ({
|
|||||||
quality: '错误',
|
quality: '错误',
|
||||||
loadSpeed: '未知',
|
loadSpeed: '未知',
|
||||||
pingTime: 0,
|
pingTime: 0,
|
||||||
|
bitrate: '未知',
|
||||||
hasError: true,
|
hasError: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user