From d741cea442b00dcd72646a2cfc3ce0a0a8f5db88 Mon Sep 17 00:00:00 2001 From: shinya Date: Fri, 11 Jul 2025 02:47:39 +0800 Subject: [PATCH] fix: try to fix year --- src/app/play/page.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index 6b90f24..9246024 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -719,8 +719,9 @@ function PlayPageClient() { const newDetail = await fetchVideoDetail({ source: newSource, id: newId, - fallbackTitle: newTitle.trim(), - fallbackYear: videoYearRef.current, + fallbackTitle: searchTitle || newTitle.trim(), + fallbackYear: + videoYearRef.current === 'unknown' ? '' : videoYearRef.current, }); // 尝试跳转到当前正在播放的集数 @@ -743,9 +744,11 @@ function PlayPageClient() { const newUrl = new URL(window.location.href); newUrl.searchParams.set('source', newSource); newUrl.searchParams.set('id', newId); + newUrl.searchParams.set('year', newDetail.year || 'unknown'); window.history.replaceState({}, '', newUrl.toString()); setVideoTitle(newDetail.title || newTitle); + setVideoYear(newDetail.year || 'unknown'); setVideoCover(newDetail.poster); setCurrentSource(newSource); setCurrentId(newId);