fix: aggreaget match and keyword trim

This commit is contained in:
shinya
2025-07-04 01:23:22 +08:00
parent f266ae0dc1
commit 6492191a2d
10 changed files with 36 additions and 27 deletions

View File

@@ -274,7 +274,7 @@ function PlayPageClient() {
const detailData = await fetchVideoDetail({
source: currentSource,
id: currentId,
fallbackTitle: videoTitle,
fallbackTitle: videoTitle.trim(),
fallbackYear: videoYear,
});
@@ -531,7 +531,7 @@ function PlayPageClient() {
try {
const response = await fetch(
`/api/search?q=${encodeURIComponent(query)}`
`/api/search?q=${encodeURIComponent(query.trim())}`
);
if (!response.ok) {
throw new Error('搜索失败');
@@ -614,7 +614,7 @@ function PlayPageClient() {
const newDetail = await fetchVideoDetail({
source: newSource,
id: newId,
fallbackTitle: newTitle,
fallbackTitle: newTitle.trim(),
fallbackYear: videoYear,
});
@@ -1100,7 +1100,7 @@ function PlayPageClient() {
onClick={() => {
if (videoTitle) {
window.location.href = `/aggregate?q=${encodeURIComponent(
videoTitle
videoTitle.trim()
)}${videoYear ? `&year=${encodeURIComponent(videoYear)}` : ''}`;
} else {
window.location.href = '/';
@@ -1125,7 +1125,7 @@ function PlayPageClient() {
// 返回选源页
if (videoTitle) {
window.location.href = `/aggregate?q=${encodeURIComponent(
videoTitle
videoTitle.trim()
)}${videoYear ? `&year=${encodeURIComponent(videoYear)}` : ''}`;
} else {
window.location.href = '/';