dsh-half-page 0.4.48 → 0.4.51

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.4.50
4
+
5
+ - 书房时间下面那行只写「上次提醒:… · 今天已叫 N 次」,不再显示没有意义的 1/1 比例。
6
+
3
7
  ## 0.4.48
4
8
 
5
9
  这一版三件事:**一本书可以被几个读者分开读**、**书房时间改成「隔多久叫一次」**、**备份/恢复/检查更新真正能用了**。
package/client.js CHANGED
@@ -41,10 +41,8 @@ window.__ModuleLoader__.load({
41
41
  function studyLine(s) {
42
42
  if (!s) return ''
43
43
  const last = s.lastAt ? new Date(s.lastAt).toLocaleString('zh-CN', { hour12: false }) : '还没有'
44
- const byDay = s.mode === 'day'
45
- const used = byDay ? (s.dayCount || 0) : (s.weekCount || 0)
46
- const cap = byDay ? (s.perDay || 1) : (s.perWeek || 3)
47
- return '上次提醒:' + last + ' · ' + (byDay ? '今天' : '本周') + '已叫 ' + used + '/' + cap + ' 次'
44
+ const used = (s.dayCount || 0)
45
+ return '上次提醒:' + last + ' · 今天已叫 ' + used + ' 次'
48
46
  }
49
47
  const copy = (t) => { try { navigator.clipboard.writeText(t) } catch {} }
50
48
 
package/index.js CHANGED
@@ -2469,8 +2469,9 @@ async function signWork(rel, who) {
2469
2469
  parameters: obj(),
2470
2470
  output: textOut,
2471
2471
  async execute(args, exec) {
2472
- const { dir, perDay, st, shelf, readToday: rt, today: t } = await stateOf()
2473
- const reader = await readerOf(exec)
2472
+ const { dir, perDay, st, shelf, today: t } = await stateOf()
2473
+ const reader = await readerOf(exec)
2474
+ const rt = readTodayOf(st, reader.id)
2474
2475
  const books = []
2475
2476
  for (const b of shelf) {
2476
2477
  const r = st.books[b.id] || {}
@@ -2526,8 +2527,9 @@ async function signWork(rel, who) {
2526
2527
  const q = inQuietNow(await config())
2527
2528
  if (q) throw new Error(`静音时段(${q.fromText}–${q.toText}),不自动读。真要读请传 force: true`)
2528
2529
  }
2529
- const { dir, perDay, st, readToday: rt } = await stateOf()
2530
- const reader = await readerOf(exec)
2530
+ const { dir, perDay, st } = await stateOf()
2531
+ const reader = await readerOf(exec)
2532
+ const rt = readTodayOf(st, reader.id)
2531
2533
  // 取书口径跟 reading_note 一致:明说 > 我自己刚读的那本 > 全局当前那本
2532
2534
  const id = args?.book || lastReadBookOf(st, reader.id)
2533
2535
  if (!id) throw new Error('不知道读哪本:传 book,或先读过一本')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-half-page",
3
- "version": "0.4.48",
3
+ "version": "0.4.51",
4
4
  "private": false,
5
5
  "author": "鹿野 <luye@dsh.local>",
6
6
  "license": "MIT",