dsh-rank-scan 0.6.0 → 0.6.1

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/README.md CHANGED
@@ -18,7 +18,7 @@ DeepSeek Harness 扫榜插件:定时 + 按需采集多站小说榜单,算变
18
18
 
19
19
  ```sh
20
20
  dsh plugin --profile desktop add github:kilo-s/dsh-rank-scan
21
- # 钉版本:github:kilo-s/dsh-rank-scan#v0.6.0
21
+ # 钉版本:github:kilo-s/dsh-rank-scan#v0.6.1
22
22
  ```
23
23
 
24
24
  仓库不含编译产物,这条命令会在安装时现场构建 `lib/`。首次可能被 pnpm 拦下构建脚本(它会打印要放行的键,加进 `allowBuilds` 后重跑即可),细节见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
@@ -37,14 +37,14 @@ dsh plugin --profile desktop add "<tgz 的完整路径>"
37
37
 
38
38
  ```sh
39
39
  dsh plugin --profile desktop add dsh-rank-scan
40
- # 钉版本:dsh-rank-scan@0.6.0
40
+ # 钉版本:dsh-rank-scan@0.6.1
41
41
  ```
42
42
 
43
43
  npm 上那份是 CI 从源码构建的(包内自带 `lib/`,发布带 `--provenance` 签名)——装的时候不用再编译,也不会被 pnpm 的 `allowBuilds` 拦下。面板的「检查更新」读的就是 npm 上的版本号。
44
44
 
45
45
  **验证**:重开 DSH 后左侧栏会话列表下方应出现「扫榜」入口;或访问 `http://127.0.0.1:19387/api/rank-scan/health`,返回 `{ok:true,...}` 即通。
46
46
 
47
- **更新**:重跑安装命令即可(链接直装取最新 `main`,registry 装取最新发布版;本版本为 **0.6.0**);面板「设置」页底部会读 npm 上的版本号提示有没有新版,装了 [dsh-market](https://github.com/dsh-market/dsh-market) 的话还能就地更新。
47
+ **更新**:重跑安装命令即可(链接直装取最新 `main`,registry 装取最新发布版;本版本为 **0.6.1**);面板「设置」页底部会读 npm 上的版本号提示有没有新版,装了 [dsh-market](https://github.com/dsh-market/dsh-market) 的话还能就地更新。
48
48
 
49
49
  **卸载**:`dsh plugin --profile desktop remove dsh-rank-scan`。数据目录 `~/.dsh/data/rank-scan` 会保留,要彻底清理自行删除;脚本化卸载与 patch 安全口径见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
50
50
 
package/lib/client.js CHANGED
@@ -768,7 +768,6 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
768
768
  days: 3, author: 4, fans: 4,
769
769
  cat: 5, score: 5,
770
770
  subCat: 6, settledDays: 6,
771
- updated: 7,
772
771
  }
773
772
  /** 优先级数字越大越先被丢;7 天增量的 daily0..6 排最后 */
774
773
  const colPrio = function (c) {
@@ -783,7 +782,6 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
783
782
  const colEst = function (c) {
784
783
  const k = String((c && c.key) || '')
785
784
  if (k === 'title') return 200
786
- if (k === 'updated') return 124
787
785
  if (k === 'rank') return 36
788
786
  if (k === 'delta') return 50
789
787
  if (/^daily\d+$/.test(k)) return 46
@@ -2297,13 +2295,11 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
2297
2295
  // ★ 2026-10-29 口径修正:三江这一列是「日期」(Unix 秒时间戳),不是「首日增量」⇒ 显示成 MM-DD HH:mm
2298
2296
  if (k === 'firstDay') return fmtStamp(ex.firstDay)
2299
2297
  if (k === 'firstV') return dash(ex.firstV)
2300
- if (k === 'update') return dash(ex.update)
2301
2298
  if (k === 'collect') return fmtRead(ex.collect)
2302
2299
  if (k === 'collectBase') return fmtRead(ex.collectBase)
2303
2300
  if (k === 'fans') return fmtRead(ex.fans)
2304
2301
  if (k === 'score') return dash(ex.score)
2305
2302
  if (k === 'words') return fmtWords(ex.wordsText !== undefined ? ex.wordsText : ex.wordsCnt !== undefined ? ex.wordsCnt : ex.wordNumber !== undefined ? ex.wordNumber : ex.words)
2306
- if (k === 'updated') return fmtTime(ex.lastChapterUpdateTime)
2307
2303
  if (k === 'subCat') return dash(ex.subCat)
2308
2304
  if (k === 'cat') return dash(ex.cat)
2309
2305
  if (k === 'days') return dash(r.days)
@@ -3330,12 +3326,12 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
3330
3326
  * 右半张桌子全空,被删掉的指标也没有别处可看。窄的时候改成**卡片行**:
3331
3327
  * 第一行 名次 · 书名 · 作者 · 星标;第二行把这一榜要看的指标做成 chip(放不下自动换行)。
3332
3328
  */
3333
- const CHIP_SKIP = { title: 1, rank: 1, author: 1, cat: 1, subCat: 1, updated: 1, days: 1 }
3329
+ const CHIP_SKIP = { title: 1, rank: 1, author: 1, cat: 1, subCat: 1, days: 1 }
3334
3330
  /**
3335
3331
  * 0.6 收尾:卡片第二行的中点串除了「按列序前 6 个」,还要**保证新补的四列在**里
3336
3332
  * (它们在列序里靠后,光靠 slice(0,6) 会被切掉);空值仍由渲染处跳过。
3337
3333
  */
3338
- const CHIP_ALWAYS = { shouding: 1, firstDay: 1, firstV: 1, update: 1 }
3334
+ const CHIP_ALWAYS = { shouding: 1, firstDay: 1, firstV: 1 }
3339
3335
  const chipCols = (function () {
3340
3336
  const all = ((data && data.columns) || []).filter(function (c) { return !CHIP_SKIP[c.key] })
3341
3337
  const head = all.slice(0, 6)
@@ -3349,7 +3345,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
3349
3345
  * 增量只能靠拉宽面板看)。这里算出「当前视图没显示的列」,在行详情里用**同一套 cell 渲染器**
3350
3346
  * 补全 —— 不截断真实字段,也不改现有列宽/收起策略。
3351
3347
  */
3352
- const SUMMARY_COLS = { title: 1, rank: 1, author: 1, words: 1, updated: 1 }
3348
+ const SUMMARY_COLS = { title: 1, rank: 1, author: 1, words: 1 }
3353
3349
  const shownColKeys = (function () {
3354
3350
  const m = {}
3355
3351
  if (cards) {
@@ -3384,10 +3380,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
3384
3380
  return h('div', { style: { ...C.detail, marginTop: '4px' } },
3385
3381
  h('div', { style: { fontWeight: 600 } }, dash(r.title)),
3386
3382
  h('div', { style: C.muted }, '作者 ' + dash(r.author) + ' · 名次 ' + dash(r.rank) + ' · 字数 ' + fmtWords(ex.wordsText || ex.wordsCnt || ex.wordNumber || ex.words)),
3387
- // 「更新」只有番茄榜单页给(lastChapterUpdateTime);没这个字段的榜整行不渲染,不显示「更新 —」
3388
- ex.lastChapterUpdateTime != null && Number(ex.lastChapterUpdateTime) > 0
3389
- ? h('div', { style: C.muted }, '更新 ' + fmtTime(ex.lastChapterUpdateTime))
3390
- : null,
3383
+ // ★ 0.6.1(使用者 2026-10-29「统一去掉」):详情卡也不再显示「更新 …」——
3384
+ // 它和榜单列的「更新时间」是同一个字段(番茄 `lastChapterUpdateTime`),留着就还是不一致。
3391
3385
  // 简介:只有真有 desc 的行才渲染(没有就整块不出现,不显示「—」)
3392
3386
  h(BoardDesc, { text: ex.desc }),
3393
3387
  // 被当前宽度收起的列:在这里逐条列出(label + 与表格完全相同的渲染)
package/lib/index.js CHANGED
@@ -19,7 +19,7 @@ import { authorFromBookTitle, makeSfacgSite, SFACG_BOARDS } from './sites/sfacg.
19
19
  import { CIWEIMAO_BOARDS, CIWEIMAO_BUY_URL } from './sites/ciweimao.js';
20
20
  import { FANQIE_MALE } from './sites/fanqie.js';
21
21
  import { CATEGORIES as QIDIAN_CATEGORIES } from './sites/qidian-mobile.js';
22
- import { deriveFanqieViews } from './scan/derive.js';
22
+ import { deriveFanqieViews, poolDateOf } from './scan/derive.js';
23
23
  import { decodePua, hasPua, learnPair, loadFontMap, saveFontMap } from './scan/fontmap.js';
24
24
  import { applyColumnPolicy, batchKeyOf, batchKindOf, batchLabelOf, boardMeta, columnsFor, compareDesc, defaultSortFor, defaultSortKeyFor, enrichAttemptPolicy, enrichMissingCount, groupBySite, groupChanges, isBatchBoard, isEnrichableBoard, saleRangeOf, shouldShowDays, usesRankDelta, withFanqieCat } from './scan/view.js';
25
25
  import { BookmarkService, BookmarkStore } from './scan/bookmark.js';
@@ -1889,7 +1889,26 @@ export function apply(ctx, config) {
1889
1889
  if (boardId.startsWith('fanqie.derived.')) {
1890
1890
  const read = (b, d) => store.readSnapshot(d, b);
1891
1891
  const pool = st.boards.filter((b) => b.startsWith('fanqie.m.'));
1892
- const views = deriveFanqieViews(read, { date: latest, poolBoards: pool, dataDates: dates });
1892
+ /**
1893
+ * ★ 0.6.1(使用者 2026-10-29「番茄在读周榜有时候卡住显示不了内容」):
1894
+ * 原来拿**全局最新数据日** latest 建池。今天的目录可能只有别的站(实测 2026-10-29 只有起点
1895
+ * 三个榜,番茄 0 个快照)⇒ 池子为空 ⇒ 0 行,而 note 照常输出「已结算 N/7 天」,
1896
+ * 看上去就像面板卡住没内容。
1897
+ * 现在:算池子的日期 = **最新一个番茄真有快照的日期**;全局最新日另有提示。
1898
+ */
1899
+ const hasPoolRows = (d) => pool.some((b) => {
1900
+ const s = store.readSnapshot(d, b);
1901
+ return !!(s && s.rows && s.rows.length);
1902
+ });
1903
+ const poolDates = dates.filter(hasPoolRows);
1904
+ const poolDate = poolDateOf(dates, hasPoolRows);
1905
+ const calcDate = poolDate || latest;
1906
+ const lagNote = !poolDate
1907
+ ? '番茄还没有任何本地快照(' + latest + ' 也没有):先在「设置 → 抓取范围」里勾上番茄,或等下次扫描'
1908
+ : poolDate !== latest
1909
+ ? '番茄最新快照是 ' + poolDate + '(' + latest + ' 还没有番茄快照),本榜按 ' + poolDate + ' 算'
1910
+ : null;
1911
+ const views = deriveFanqieViews(read, { date: calcDate, poolBoards: pool, dataDates: poolDates });
1893
1912
  const v = views.find((x) => x.boardId === boardId) || views[0];
1894
1913
  // 派生榜行自带 extra.periodDelta / gain / settledDays;days 位给「池内天数」(列被 hideColumnsFor 隐藏,仅作诊断)
1895
1914
  let rows = (v ? v.rows : []).map((r) => ({ ...r, days: r.extra && r.extra.inPoolDays != null ? r.extra.inPoolDays : null }));
@@ -1905,7 +1924,7 @@ export function apply(ctx, config) {
1905
1924
  defaultSortKey,
1906
1925
  sortOptions: sortOptionsFor(boardId, meta, { hasHistory }),
1907
1926
  depth: (st.depths || {})[boardId] ?? 30,
1908
- dataDate: latest,
1927
+ dataDate: calcDate,
1909
1928
  dates: datesFor,
1910
1929
  // 期首 = 本期周一(自然周口径);面板「基期」显示的就是它
1911
1930
  baselineDate: v ? v.periodStart : null,
@@ -1914,9 +1933,10 @@ export function apply(ctx, config) {
1914
1933
  settledDays: v ? v.settledDays : 0,
1915
1934
  elapsed: v ? v.elapsed : 0,
1916
1935
  datesLabel: v ? v.datesLabel : '',
1917
- firstEver: dates.length < 2,
1936
+ firstEver: poolDates.length < 2,
1918
1937
  rows,
1919
- note: v ? v.note : null,
1938
+ // 池子不是按「全局最新日」算的时候,必须说清用的是哪天(不然空表看不出原因)
1939
+ note: [lagNote, v ? v.note : null].filter(Boolean).join(';') || null,
1920
1940
  };
1921
1941
  }
1922
1942
  let snap = store.readSnapshot(date, boardId);