mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-23 19:52:09 +08:00
fix: aggreaget match and keyword trim
This commit is contained in:
@@ -34,7 +34,7 @@ export async function fetchVideoDetail({
|
||||
if (fallbackTitle) {
|
||||
try {
|
||||
const searchResp = await fetch(
|
||||
`/api/search?q=${encodeURIComponent(fallbackTitle)}`
|
||||
`/api/search?q=${encodeURIComponent(fallbackTitle.trim())}`
|
||||
);
|
||||
if (searchResp.ok) {
|
||||
const searchData = await searchResp.json();
|
||||
@@ -61,7 +61,7 @@ export async function fetchVideoDetail({
|
||||
|
||||
return {
|
||||
id: data?.videoInfo?.id || id,
|
||||
title: data?.videoInfo?.title || fallbackTitle,
|
||||
title: data?.videoInfo?.title.trim() || fallbackTitle.trim(),
|
||||
poster: data?.videoInfo?.cover || '',
|
||||
episodes: data?.episodes || [],
|
||||
source: data?.videoInfo?.source || source,
|
||||
|
||||
@@ -27,7 +27,7 @@ async function refreshRecordAndFavorites() {
|
||||
promise = fetchVideoDetail({
|
||||
source,
|
||||
id,
|
||||
fallbackTitle,
|
||||
fallbackTitle: fallbackTitle.trim(),
|
||||
fallbackYear: '',
|
||||
});
|
||||
detailCache.set(key, promise);
|
||||
|
||||
Reference in New Issue
Block a user