From 81588443f1235eef9fe3d4e456519ea745fd2aad Mon Sep 17 00:00:00 2001 From: mtvpls Date: Fri, 5 Dec 2025 00:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A8=E6=BC=AB=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=AF=8F=E6=97=A5=E6=94=BE=E9=80=81=E6=97=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=97=B6=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/douban/page.tsx | 26 ++++++++++++++------------ src/app/page.tsx | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/app/douban/page.tsx b/src/app/douban/page.tsx index 348cfb5..281bf21 100644 --- a/src/app/douban/page.tsx +++ b/src/app/douban/page.tsx @@ -312,18 +312,20 @@ function DoubanPageClient() { data = { code: 200, message: 'success', - list: weekdayData.items.map((item) => ({ - id: item.id?.toString() || '', - title: item.name_cn || item.name, - poster: - item.images.large || - item.images.common || - item.images.medium || - item.images.small || - item.images.grid, - rate: item.rating?.score?.toFixed(1) || '', - year: item.air_date?.split('-')?.[0] || '', - })), + list: weekdayData.items + .filter((item) => item.images) // 过滤掉没有图片的 + .map((item) => ({ + id: item.id?.toString() || '', + title: item.name_cn || item.name, + poster: + item.images.large || + item.images.common || + item.images.medium || + item.images.small || + item.images.grid, + rate: item.rating?.score?.toFixed(1) || '', + year: item.air_date?.split('-')?.[0] || '', + })), }; } else { throw new Error('没有找到对应的日期'); diff --git a/src/app/page.tsx b/src/app/page.tsx index ee56e4d..3d4198f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -412,11 +412,11 @@ function HomeClient() { ]; const currentWeekday = weekdays[today.getDay()]; - // 找到当前星期对应的番剧数据 + // 找到当前星期对应的番剧数据,并过滤掉没有图片的 const todayAnimes = bangumiCalendarData.find( (item) => item.weekday.en === currentWeekday - )?.items || []; + )?.items.filter((anime) => anime.images) || []; return todayAnimes.map((anime, index) => (