迁移播放记录到新数据结构,新增自动清理播放记录

This commit is contained in:
mtvpls
2025-12-30 21:00:10 +08:00
parent 6ad268d319
commit f43d9c7d0e
7 changed files with 381 additions and 29 deletions
@@ -201,6 +201,13 @@ export async function POST(req: NextRequest) {
}
}
}
// 标记播放记录已迁移(新导入的数据直接使用hash结构)
const storage = (db as any).storage;
if (storage && typeof storage.client?.hSet === 'function') {
const userInfoKey = `user:${username}:info`;
await storage.client.hSet(userInfoKey, 'playrecord_migrated', 'true');
}
}
return NextResponse.json({