@cloud411716/fancy-webnovel 0.2.20 → 0.2.21

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -293,33 +293,28 @@ async function scrapeRank(rankTypeId, channelId) {
293
293
  "",
294
294
  `- 来源:${url}`,
295
295
  `- 抓取时间:${now}`,
296
+ `- 条目数:${totalBooks}`,
296
297
  "",
297
298
  "---",
298
299
  "",
299
300
  ];
300
301
 
301
302
  for (const ch of data.channels) {
302
- lines.push(`## ${ch.name}`, "");
303
- for (let i = 0; i < ch.books.length; i++) {
304
- const b = ch.books[i];
305
- lines.push(`书名:${b.title || ""}`);
306
- lines.push(`作者:${b.author || ""}`);
307
- if (data.layout === 'A') {
308
- // 布局A(表格型):已有丰富字段,直接使用
309
- if (b.type) lines.push(`类型:${b.type}`);
310
- if (b.progress) lines.push(`进度:${b.progress}`);
311
- if (b.words) lines.push(`字数:${b.words}`);
312
- if (b.score) lines.push(`积分:${b.score}`);
313
- if (b.pubtime) lines.push(`发表时间:${b.pubtime}`);
314
- lines.push(`题材:${b.type ? b.type.split('-')[1] || b.type : ""}`);
315
- } else {
316
- // 布局B(交替行型):只有书名/作者,其他留空让详情补采
317
- lines.push(`题材:${ch.name}`);
303
+ for (let i = 0; i < ch.books.length; i++) {
304
+ const b = ch.books[i];
305
+ var genre = '';
306
+ if (data.layout === 'A' && b.type) {
307
+ var parts = b.type.split('-');
308
+ genre = parts[1] || '';
309
+ } else {
310
+ genre = ch.name;
311
+ }
312
+ lines.push(`书名:${b.title || ""}`);
313
+ lines.push(`题材:${genre}`);
314
+ lines.push(`作者:${b.author || ""}`);
315
+ if (b.novelid) lines.push(`作品页:https://www.jjwxc.net/onebook.php?novelid=${b.novelid}`);
316
+ lines.push("");
318
317
  }
319
- if (b.novelid) lines.push(`作品页:https://www.jjwxc.net/onebook.php?novelid=${b.novelid}`);
320
- lines.push("");
321
- }
322
- lines.push("--", "");
323
318
  }
324
319
 
325
320
  return {