@cloud411716/fancy-webnovel 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/fancy-scan/index.js +12 -5
package/package.json
CHANGED
|
@@ -78,8 +78,8 @@ export async function apply(ctx) {
|
|
|
78
78
|
|
|
79
79
|
// ---------- 串行采集 ----------
|
|
80
80
|
let allFiles = [];
|
|
81
|
-
let failed = 0;
|
|
82
81
|
let lastReceipt = null;
|
|
82
|
+
const failedRanks = []; // 收集失败项:{ rank, err }
|
|
83
83
|
|
|
84
84
|
for (const rank of unique) {
|
|
85
85
|
const stop = startActivity(session);
|
|
@@ -108,16 +108,14 @@ export async function apply(ctx) {
|
|
|
108
108
|
);
|
|
109
109
|
return { kind: 'success', text: '' };
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
failed++;
|
|
111
|
+
failedRanks.push({ rank, err: rawErr });
|
|
113
112
|
continue;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
// 解析采集结果
|
|
117
116
|
let receipt;
|
|
118
117
|
try { receipt = JSON.parse(r.output); } catch (_) {
|
|
119
|
-
|
|
120
|
-
failed++;
|
|
118
|
+
failedRanks.push({ rank, err: 'JSON 解析失败' });
|
|
121
119
|
continue;
|
|
122
120
|
}
|
|
123
121
|
lastReceipt = receipt;
|
|
@@ -143,6 +141,15 @@ export async function apply(ctx) {
|
|
|
143
141
|
llmFollowup(invocation, prompt);
|
|
144
142
|
}
|
|
145
143
|
|
|
144
|
+
// 统一展示所有失败项
|
|
145
|
+
if (failedRanks.length > 0) {
|
|
146
|
+
const lines = failedRanks.map(({ rank, err }) => {
|
|
147
|
+
const label = `${rank.channel}/${rank.type}`;
|
|
148
|
+
return `• ${label}:${err}`;
|
|
149
|
+
});
|
|
150
|
+
notify(session, `⚠️ 以下榜单采集失败(共 ${failedRanks.length} 项):\n${lines.join('\n')}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
146
153
|
return { kind: 'success', text: '' };
|
|
147
154
|
},
|
|
148
155
|
});
|