From eb0127108518f3f8893b6b1bec7bcdcd206d984d Mon Sep 17 00:00:00 2001 From: Patrick-Ze <19711799+Patrick-Ze@users.noreply.github.com> Date: Mon, 25 Aug 2025 22:50:51 +0800 Subject: [PATCH] =?UTF-8?q?js:=20CD-Aware-AutoGather:=20=E6=8D=95=E8=8E=B7?= =?UTF-8?q?json=E6=96=87=E4=BB=B6=E6=97=A0=E6=95=88=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E8=84=9A=E6=9C=AC=E5=BC=82=E5=B8=B8=20(#1706)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/CD-Aware-AutoGather/main.js | 9 +++++++-- repo/js/CD-Aware-AutoGather/manifest.json | 2 +- repo/pathing/食材与炼金/晶蝶/晶蝶-稻妻-踏鞴砂-12个.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repo/js/CD-Aware-AutoGather/main.js b/repo/js/CD-Aware-AutoGather/main.js index c1442c745..7d4fdfd76 100644 --- a/repo/js/CD-Aware-AutoGather/main.js +++ b/repo/js/CD-Aware-AutoGather/main.js @@ -180,8 +180,13 @@ async function runClearMode() { function scanSpecialCollectMethod(jsonFiles) { const actions = jsonFiles.flatMap((filePath) => { - const data = JSON.parse(file.readTextSync(filePath)); - return data.positions.map((p) => p.action).filter((a) => a); + try { + const data = JSON.parse(file.readTextSync(filePath)); + return data.positions.map((p) => p.action).filter((a) => a); + } catch (e) { + log.warn(`json文件无效: {0}: ${e.message}`, filePath); + return []; + } }); return [...new Set(actions)]; } diff --git a/repo/js/CD-Aware-AutoGather/manifest.json b/repo/js/CD-Aware-AutoGather/manifest.json index f36566247..66ecee185 100644 --- a/repo/js/CD-Aware-AutoGather/manifest.json +++ b/repo/js/CD-Aware-AutoGather/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "带CD管理的自动采集", - "version": "1.5", + "version": "1.6", "bgi_version": "0.45.0", "description": "自动同步你通过BetterGI订阅的地图追踪任务,执行采集任务,并管理材料刷新时间(支持多账号)。\n首次使用前请先简单阅读说明(可在`全自动`——`JS脚本`页面,点击本脚本名称查看)", "authors": [ diff --git a/repo/pathing/食材与炼金/晶蝶/晶蝶-稻妻-踏鞴砂-12个.json b/repo/pathing/食材与炼金/晶蝶/晶蝶-稻妻-踏鞴砂-12个.json index d91593e93..65e521472 100644 --- a/repo/pathing/食材与炼金/晶蝶/晶蝶-稻妻-踏鞴砂-12个.json +++ b/repo/pathing/食材与炼金/晶蝶/晶蝶-稻妻-踏鞴砂-12个.json @@ -1,7 +1,7 @@ { "info": { "name": "晶蝶-稻妻-踏鞴砂-12个", - "type": "collect" + "type": "collect", "version": "1.0", "description": "", "authors": [