Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(diagnostics): 按快照刷新行为显示来源故障提示

longmeidao4113c9f358f8
diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.md
index fc8693349..256a7fe58 100644
--- a/docs/OPERATIONS.md
+++ b/docs/OPERATIONS.md
@@ -74,7 +74,7 @@ Windows 测试包的数据根是 `%LOCALAPPDATA%\Peach\peach-data`。
服务在后台读取挂载目录的首个条目,空目录可读也算在线。正常来源每 600 秒检测,异常来源每 60 秒检测;首次失败隔一秒复查,连续两次失败才确认故障。提示分别说明没有权限读取、目录不存在、目标不是目录或目录读取失败。
-`/api/sources` 返回周期快照和检测时间;正在检测或探测未返回时,`online` 为 `null`,页面保留来源可用状态。实际播放和扫描仍即时检查目录。`/healthz` 的 `media_mounts` 摘要与托盘显示来源名和故障原因;挂载故障不触发正常服务重启。探测线程最多四个,同一目录有未返回的探测时不重复启动。
+`/api/sources` 返回周期快照和检测时间;正在检测或探测未返回时,`online` 为 `null`,页面保留来源可用状态。故障面板的「刷新状态」读取最新快照,后台按上述间隔重新探测。实际播放和扫描仍即时检查目录。`/healthz` 的 `media_mounts` 摘要与托盘显示来源名和故障原因;挂载故障不触发正常服务重启。探测线程最多四个,同一目录有未返回的探测时不重复启动。
### 在 macOS 上对应 Windows 路径:`[media.mounts]`
diff --git a/frontend/e2e/item-detail.test.ts b/frontend/e2e/item-detail.test.ts
index a4c024d03..bf539ee95 100644
--- a/frontend/e2e/item-detail.test.ts
+++ b/frontend/e2e/item-detail.test.ts
@@ -88,7 +88,7 @@ describe('作品详情岛', () => {
}
});
- it('来源没挂载:说明块代替播放器,重新检测仍未挂载就换成再试', { timeout: 60_000 }, async () => {
+ it('来源不可读取:说明块代替播放器,刷新状态后显示读取结果', { timeout: 60_000 }, async () => {
const opened = await openItemPage(browser, `/item/${ITEM.offline}`, DESKTOP);
try {
const page = opened.page;
@@ -96,7 +96,7 @@ describe('作品详情岛', () => {
assert.match(await gate.innerText(), /脱盘模式/);
assert.equal(await page.locator('#stage .vjs-tech').count(), 0, '脱盘的条目挂了播放器');
await page.locator('#offlineRetry').click();
- await page.locator('#offlineRetry', { hasText: '仍未挂载 · 再试' }).waitFor();
+ await page.locator('#offlineRetry', { hasText: '仍无法读取 · 刷新' }).waitFor();
assert.deepEqual(opened.problems, []);
} finally {
await opened.close();
diff --git a/frontend/src/react/item-detail/item-detail-page.tsx b/frontend/src/react/item-detail/item-detail-page.tsx
index e70d62c5d..76f316679 100644
--- a/frontend/src/react/item-detail/item-detail-page.tsx
+++ b/frontend/src/react/item-detail/item-detail-page.tsx
@@ -158,7 +158,7 @@ function OfflineGate({ item, badge, helpers, actions }: {
<b>脱盘模式</b>
<span>{helpers.offlineReason(item.location || '')}</span>
<button className="chip" id="offlineRetry" type="button" disabled={checking} onClick={() => void retry()}>
- {still ? '仍未挂载 · 再试' : '重新检测'}
+ {still ? '仍无法读取 · 刷新' : '刷新状态'}
</button>
</div>
);
diff --git a/web/dist/peach-react.js b/web/dist/peach-react.js
index 5d4ecda86..7a0558a5e 100644
--- a/web/dist/peach-react.js
+++ b/web/dist/peach-react.js
@@ -78786,7 +78786,7 @@ function SKe({ item: e, badge: t, helpers: n, actions: r }) {
type: "button",
disabled: i,
onClick: () => void c(),
- children: o ? "仍未挂载 · 再试" : "重新检测"
+ children: o ? "仍无法读取 · 刷新" : "刷新状态"
})
]
});