mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-16 03:33:25 +08:00
js: CD-Aware-AutoGather: 捕获json文件无效导致的脚本异常 (#1706)
This commit is contained in:
@@ -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)];
|
||||
}
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "晶蝶-稻妻-踏鞴砂-12个",
|
||||
"type": "collect"
|
||||
"type": "collect",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"authors": [
|
||||
|
||||
Reference in New Issue
Block a user