From cb5b2e7d0f981a849d73dd6ea19772775750af76 Mon Sep 17 00:00:00 2001 From: MoEFusion Date: Sat, 6 Jun 2026 15:22:25 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- docs/RELAY_PLAY_STATE_INTEGRATION.md | 3 +-- module/relay_play_state_submit.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/RELAY_PLAY_STATE_INTEGRATION.md b/docs/RELAY_PLAY_STATE_INTEGRATION.md index 7c342a7..fa31d06 100644 --- a/docs/RELAY_PLAY_STATE_INTEGRATION.md +++ b/docs/RELAY_PLAY_STATE_INTEGRATION.md @@ -60,8 +60,7 @@ const { console.log(' [2] 上传播放状态...') try { // 生成 sessionId(12 位大写字母和数字) - const sessionId = Math.random().toString(36).substring(2, 8).toUpperCase() + - Math.random().toString(36).substring(2, 8).toUpperCase() + const sessionId = Array.from({ length: 12 }, () => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'[Math.floor(Math.random() * 36)]).join('') // 2.1 提交播放开始状态(relay_play_state_submit) const relayResult = await relay_play_state_submit({ diff --git a/module/relay_play_state_submit.js b/module/relay_play_state_submit.js index fd698e9..ac87205 100644 --- a/module/relay_play_state_submit.js +++ b/module/relay_play_state_submit.js @@ -19,7 +19,7 @@ module.exports = (query, request) => { id: String(id), type: type }, - progress: progress, + progress: Number(progress) || 0, sessionId: sessionId, playMode: playMode })