diff --git a/migrations/003_add_new_episodes_to_play_records.sql b/migrations/003_add_new_episodes_to_play_records.sql new file mode 100644 index 0000000..ee2c3b1 --- /dev/null +++ b/migrations/003_add_new_episodes_to_play_records.sql @@ -0,0 +1,8 @@ +-- ============================================ +-- 添加 new_episodes 字段到播放记录表 +-- 版本: 1.0.1 +-- 创建时间: 2026-02-19 +-- ============================================ + +-- 为播放记录表添加 new_episodes 字段(用于显示新增剧集提示) +ALTER TABLE play_records ADD COLUMN new_episodes INTEGER; diff --git a/migrations/postgres/003_add_new_episodes_to_play_records.sql b/migrations/postgres/003_add_new_episodes_to_play_records.sql new file mode 100644 index 0000000..cc40e0c --- /dev/null +++ b/migrations/postgres/003_add_new_episodes_to_play_records.sql @@ -0,0 +1,8 @@ +-- ============================================ +-- 添加 new_episodes 字段到播放记录表 +-- 版本: 1.0.1 +-- 创建时间: 2026-02-19 +-- ============================================ + +-- 为播放记录表添加 new_episodes 字段(用于显示新增剧集提示) +ALTER TABLE play_records ADD COLUMN new_episodes BIGINT; diff --git a/src/app/api/cron/[password]/route.ts b/src/app/api/cron/[password]/route.ts index c28240c..a5ddee1 100644 --- a/src/app/api/cron/[password]/route.ts +++ b/src/app/api/cron/[password]/route.ts @@ -216,6 +216,14 @@ async function refreshRecordAndFavorites() { const episodeCount = detail.episodes?.length || 0; if (episodeCount > 0 && episodeCount !== record.total_episodes) { + // 计算新增的剧集数量 + const newEpisodesCount = episodeCount > record.total_episodes + ? episodeCount - record.total_episodes + : 0; + + // 如果有新增剧集,累加到现有的 new_episodes 字段 + const updatedNewEpisodes = (record.new_episodes || 0) + newEpisodesCount; + await db.savePlayRecord(user, source, id, { title: detail.title || record.title, source_name: record.source_name, @@ -227,9 +235,10 @@ async function refreshRecordAndFavorites() { total_time: record.total_time, save_time: record.save_time, search_title: record.search_title, + new_episodes: updatedNewEpisodes > 0 ? updatedNewEpisodes : undefined, }); console.log( - `更新播放记录: ${record.title} (${record.total_episodes} -> ${episodeCount})` + `更新播放记录: ${record.title} (${record.total_episodes} -> ${episodeCount}, 新增 ${newEpisodesCount} 集)` ); } diff --git a/src/app/globals.css b/src/app/globals.css index ae2660d..2a0697a 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -211,3 +211,37 @@ div[data-media-provider] video { display: none !important; } } + +/* 水波纹缩放动画 - 第一层 (快速扩散) */ +@keyframes ping-scale { + 0% { + transform: scale(1); + opacity: 0.6; + } + 75%, 100% { + transform: scale(2); + opacity: 0; + } +} + +/* 水波纹缩放动画 - 第二层 (慢速脉冲) */ +@keyframes pulse-scale { + 0%, 100% { + transform: scale(1); + opacity: 0.4; + } + 50% { + transform: scale(1.15); + opacity: 0.2; + } +} + +/* 主体徽章缩放动画 */ +@keyframes badge-scale { + 0%, 100% { + transform: scale(1); + } + 50% { + transform: scale(1.08); + } +} diff --git a/src/components/ContinueWatching.tsx b/src/components/ContinueWatching.tsx index 969e454..556e6bc 100644 --- a/src/components/ContinueWatching.tsx +++ b/src/components/ContinueWatching.tsx @@ -124,7 +124,7 @@ export default function ContinueWatching({ className }: ContinueWatchingProps) { {loading ? ( // 加载状态显示灰色占位数据(使用原始 ScrollableRow) -