From d128ac64456029031b9660bd9c4f11bce7b2d0ed Mon Sep 17 00:00:00 2001 From: XXhaos Date: Sat, 18 Apr 2026 13:14:03 +0800 Subject: [PATCH] Update capture_gamertag.js --- Scripts/capture_gamertag.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Scripts/capture_gamertag.js b/Scripts/capture_gamertag.js index 5d3fb54..0753bbc 100644 --- a/Scripts/capture_gamertag.js +++ b/Scripts/capture_gamertag.js @@ -19,7 +19,7 @@ const peoplePattern = /^https:\/\/peoplehub-public\.xboxlive\.com\/people\/gt\(.+\)/; const url = $request.url; -const MAX_RECORDS = 20; // gamertag 记录保留最近 20 条 +const MAX_RECORDS = 10; // gamertag 记录保留最近 20 条 if (peoplePattern.test(url)) { if (!$response.body) { @@ -65,15 +65,6 @@ function appendGamertagRecord(entry) { } catch (e) { records = []; } } - // 相邻去重:如果最后一条就是同一个 gamertag,只更新它的 ts,不新增 - // 这样反复刷新同账号不会产生大量冗余记录 - if (records.length > 0 && records[records.length - 1].gamertag === entry.gamertag) { - records[records.length - 1].ts = entry.ts; - $persistentStore.write(JSON.stringify(records), "gamertag_records"); - console.log(`[gamertag] 更新末条时间戳: ${entry.gamertag}`); - return; - } - records.push(entry); if (records.length > MAX_RECORDS) records = records.slice(-MAX_RECORDS); $persistentStore.write(JSON.stringify(records), "gamertag_records");