@cloud411716/fancy-webnovel 0.3.2 → 0.3.4
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
CHANGED
|
@@ -68,7 +68,7 @@ export async function apply(ctx) {
|
|
|
68
68
|
: rawChoices;
|
|
69
69
|
|
|
70
70
|
// 把 rankId 转换成 { channel, type } 并去重
|
|
71
|
-
const rankEntries = rankIds.map(id => parseRankId(platform, id));
|
|
71
|
+
const rankEntries = rankIds.map(id => parseRankId(platform, resolveId(platform, id)));
|
|
72
72
|
const unique = [];
|
|
73
73
|
const seen = new Set();
|
|
74
74
|
for (const e of rankEntries) {
|
|
@@ -144,6 +144,16 @@ export async function apply(ctx) {
|
|
|
144
144
|
// 将 rankId 转换成 { channel, type } 参数
|
|
145
145
|
// ---------------------------------------------------------------------------
|
|
146
146
|
|
|
147
|
+
// 将 label 或 id 统一成 id(UI 可能返回 label)
|
|
148
|
+
function resolveId(platform, raw) {
|
|
149
|
+
const opts = rankOptions(platform);
|
|
150
|
+
const byId = opts.find(o => o.id === raw);
|
|
151
|
+
if (byId) return byId.id;
|
|
152
|
+
const byLabel = opts.find(o => o.label === raw);
|
|
153
|
+
if (byLabel) return byLabel.id;
|
|
154
|
+
return raw; // 未知值直接透传
|
|
155
|
+
}
|
|
156
|
+
|
|
147
157
|
function parseRankId(platform, id) {
|
|
148
158
|
switch (platform) {
|
|
149
159
|
case 'qimao': {
|
|
@@ -89,7 +89,8 @@ export const scan = {
|
|
|
89
89
|
return {
|
|
90
90
|
question: `${platformLabel(platform)} 有多个榜单,支持多选。请选择要采集的榜单:`,
|
|
91
91
|
hideCustomInput: true,
|
|
92
|
-
|
|
92
|
+
multiSelect: true,
|
|
93
|
+
options: opts.map(o => ({ id: o.id, label: o.label })),
|
|
93
94
|
};
|
|
94
95
|
},
|
|
95
96
|
|