feat: optimize year match

This commit is contained in:
shinya
2025-06-26 10:19:59 +08:00
parent a45e16d3ef
commit 365c8291d4
2 changed files with 7 additions and 3 deletions

View File

@@ -144,7 +144,9 @@ async function getDetailFromApi(
cover: videoDetail.vod_pic,
desc: cleanHtmlTags(videoDetail.vod_content),
type: videoDetail.type_name,
year: videoDetail.vod_year,
year: videoDetail.vod_year
? videoDetail.vod_year.match(/\d{4}/)?.[0] || ''
: '',
area: videoDetail.vod_area,
director: videoDetail.vod_director,
actor: videoDetail.vod_actor,

View File

@@ -95,7 +95,7 @@ async function searchFromApi(
source: apiSite.key,
source_name: apiName,
class: item.vod_class,
year: item.vod_year,
year: item.vod_year ? item.vod_year.match(/\d{4}/)?.[0] || '' : '',
desc: cleanHtmlTags(item.vod_content || ''),
type_name: item.type_name,
};
@@ -165,7 +165,9 @@ async function searchFromApi(
source: apiSite.key,
source_name: apiName,
class: item.vod_class,
year: item.vod_year,
year: item.vod_year
? item.vod_year.match(/\d{4}/)?.[0] || ''
: '',
desc: cleanHtmlTags(item.vod_content || ''),
type_name: item.type_name,
};