fix: pass year to db

This commit is contained in:
shinya
2025-07-11 03:12:02 +08:00
parent b4162d0342
commit 0566693d09
2 changed files with 3 additions and 13 deletions

View File

@@ -62,19 +62,7 @@ export async function POST(request: NextRequest) {
);
}
// 保存播放记录不包含user_id将由savePlayRecord自动添加
const recordWithoutUserId = {
title: record.title,
source_name: record.source_name,
cover: record.cover,
index: record.index,
total_episodes: record.total_episodes,
play_time: record.play_time,
total_time: record.total_time,
save_time: record.save_time,
};
await db.savePlayRecord(authInfo.username, source, id, recordWithoutUserId);
await db.savePlayRecord(authInfo.username, source, id, record);
return NextResponse.json({ success: true }, { status: 200 });
} catch (err) {

View File

@@ -5,6 +5,7 @@ export interface PlayRecord {
title: string;
source_name: string;
cover: string;
year: string;
index: number; // 第几集
total_episodes: number; // 总集数
play_time: number; // 播放进度(秒)
@@ -18,6 +19,7 @@ export interface Favorite {
source_name: string;
total_episodes: number; // 总集数
title: string;
year: string;
cover: string;
save_time: number; // 记录保存时间(时间戳)
search_title?: string; // 搜索时使用的标题