Peach: Local-first video metadata scraper and media manager.
feat(config): 源码运行在配置页安装 FFmpeg 与 untrunc
longmeidaod764b6ca19d2
diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.mdindex b0537fa43..e3e5b5f4a 100644--- a/docs/OPERATIONS.md+++ b/docs/OPERATIONS.md@@ -585,7 +585,7 @@ Windows 上 TLS 私钥禁用了权限继承,只允许实际运行服务的账## 播放与转码-浏览器能直接播放的格式(例如常见的 MP4)不需要额外软件。Windows 安装版和绿色版携带 FFmpeg、ffprobe 与修复损坏 MP4 索引用的 untrunc。源码部署需要自行提供这些工具;配置页「运行信息」缺少它们时会给出下载入口。首次设置缺少 OpenSSL 时也会给出下载入口。+浏览器能直接播放的格式(例如常见的 MP4)不需要额外软件。Windows 安装版和绿色版携带 FFmpeg、ffprobe 与修复损坏 MP4 索引用的 untrunc。源码部署缺少这些工具时,Windows x64 可在配置页「应用与维护」→「运行信息」点「安装」:Peach 从最新发布下载同一份 `tools-ffmpeg.zip` 或 `tools-untrunc.zip`,经 Peach 代理设置出网,按发布摘要校验整包、按包内清单校验每个文件,再解压到数据目录的 `tools/ffmpeg`、`tools/untrunc`,装好后那一行显示版本。下载中断或校验不符时已有文件不变,再点一次即重新下载;已装且校验相符时不重复下载。macOS 与 Linux 没有发布的工具包(macOS 应用与 Docker 镜像自带工具),源码部署仍按页面上的官方下载入口自行安装,或加入 PATH。首次设置缺少 OpenSSL 时也会给出下载入口。Peach 按下面的顺序找 FFmpeg 和 ffprobe:diff --git a/docs/REUSE.md b/docs/REUSE.mdindex aee038d4d..70996db91 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -627,6 +627,7 @@ OneJAV、Free JAV Torrent 只给种子链接。这类条目经索引器同源的- 自动更新设置用 APScheduler(见「必须复用」表的定时轮询)、共享 HTTPX 发行查询、filelock 与原子 JSON 写入,安装走 `standalone_update`。按 [interval trigger](https://apscheduler.readthedocs.io/en/3.x/modules/triggers/interval.html) 每分钟查是否到期,本机持久时间与文件锁协调多个服务;关闭、6/24/168 小时间隔与源码下载限制归 Peach。默认关闭,下载只准备安装,重启仍需确认;设置存 state 目录的 `automatic-updates.json`。- 版本与资产信息用 [GitHub Releases REST API](https://docs.github.com/en/rest/releases/assets)(测试通道含预发布),查询与流式下载用项目 HTTPX,ZIP 解压用标准库,互斥用 FileLock。只有已上传完整独立包的发布才进更新,优先选择 `*-update.zip`,历史完整 ZIP 保留原名供旧客户端更新。`package_windows_release.py` 从同一构建目录生成完整包、应用更新包与 FFmpeg、untrunc、cloudflared、人脸模型(`face-models`)工具包;更新包内清单固定工具文件哈希、工具包大小与 SHA-256,运行时只复用校验相符的文件,按需下载不符的工具。清单可以多出本版不认得的工具,读取时只留本版认得的那些,认得的一个都不能少;新增工具包由该工具自己的运行时兜底补齐,不让旧版更新器拒收整个更新包。工具包路径限于对应工具目录,补齐后再次校验并沿用同卷暂存与目录回滚。复用已有 HTTPX、hashlib、zipfile、copy2,无新增依赖;不引入 Velopack 的包格式或二进制差分机制。隔离回归用实际生成的 ZIP 验证工具复用、独立补下载与失败保留现有安装,不使用真实 ledger。+- Windows 源码运行在配置页安装 FFmpeg、untrunc(`media_tools.py`)复用同一批工具包和更新器的下载、签名摘要与解压路径检查;没有更新包清单,逐文件摘要取工具包自带的 `manifest.json`。工具包与程序版本无关,取两个发布源里最新的那份,不按源码版本号拼地址。- 安装策略与进度归 Peach:下载校验后在程序同卷暂存,用户确认重启,复制出来的包内助手等原托盘退出再切换完整目录;失败保留或恢复旧目录。配置、数据库与媒体不进更新包。- 轻量安装包复用应用更新包的工具清单、`standalone_update.prepare_tools` 与既有 HTTPX、hashlib、zipfile。Inno Setup 6.7.3 用 [external 文件](https://jrsoftware.org/ishelp/topic_filessection.htm)安装临时目录中已验证的工具,用[滚动进度页](https://jrsoftware.org/ishelp/topic_isxfunc_createoutputmarqueeprogresspage.htm)显示准备状态;官方 API 已于 2026-10-17 核对。工具先在预检目录准备,成功后才暂停任务并覆盖安装;安装包旁的工具 ZIP 同样按清单校验,不读取馆藏配置或增加依赖。不引入另一套下载器或更新框架,校验及解压路径与在线更新共用。- 不用 [Velopack](https://docs.velopack.io/packaging/operating-systems/windows)(要求其安装目录与包格式)与 [WinSparkle](https://winsparkle.org/)(要求 appcast 与原生更新界面):产物是 PyInstaller ZIP、进度在 Web 显示,沿用托盘进程与目录替换协议。diff --git a/docs/TESTING_DESKTOP.md b/docs/TESTING_DESKTOP.mdindex 146431efc..2488eb34b 100644--- a/docs/TESTING_DESKTOP.md+++ b/docs/TESTING_DESKTOP.md@@ -62,7 +62,7 @@ Windows 第一次询问防火墙权限时,只勾选「专用网络」。工具以独立进程调用,按 GPL-3.0-or-later 分发;工具目录包含许可证、构建配置、来源清单和 SHA-256。完整对应源码制品 `ffmpeg-corresponding-source.zip` 与应用放在同一个 Release,包含 FFmpeg、x264、dav1d、nv-codec-headers、AMF 头文件与 libvpl 的固定源码和构建脚本。发行构建会校验工具及对应源码,任何一项缺失或哈希不符都停止打包。-源码运行可将 FFmpeg、ffprobe 加入 PATH,或放在数据目录的 `tools\ffmpeg\bin`。显式指定的 `PEACH_FFMPEG`、`PEACH_FFPROBE` 优先;独立包随后使用随包工具,再查数据目录和 PATH。+源码运行可在配置页「运行信息」点「安装」,把发布的 FFmpeg、untrunc 工具包装进数据目录的 `tools\ffmpeg`、`tools\untrunc`;也可将 FFmpeg、ffprobe 加入 PATH,或自行放在数据目录的 `tools\ffmpeg\bin`。显式指定的 `PEACH_FFMPEG`、`PEACH_FFPROBE` 优先;独立包随后使用随包工具,再查数据目录和 PATH。已在系统安装媒体工具时,可运行 [`import_windows_media_tools.cmd`](../scripts/import_windows_media_tools.cmd),它调用同目录 PowerShell 脚本检测 WinGet、Scoop、Chocolatey、PATH 和下载目录,将工具及同目录 DLL 放入 Peach 的数据目录,替换文件时保留备份。没有检测到已解压工具时,可识别下载目录中的 Gyan `ffmpeg-9.0.2-essentials_build.zip`,校验固定 SHA-256 后解压接入。脚本不修改系统 PATH 或馆藏账本;完成后刷新配置页。diff --git a/frontend/src/react/bundle.d.ts b/frontend/src/react/bundle.d.tsindex 29709f792..2d06d963e 100644--- a/frontend/src/react/bundle.d.ts+++ b/frontend/src/react/bundle.d.ts@@ -273,6 +273,8 @@ export interface ConfigurationFact {value: string;download_url?: string;download_label?: string;+ /** 能由 Peach 装进数据目录的缺失工具(`ffmpeg`、`untrunc`),有它就不给下载外链。 */+ install_tool?: string;}export interface ConfigurationData {diff --git a/frontend/src/react/pages/setup/setup-api.ts b/frontend/src/react/pages/setup/setup-api.tsindex 6f0860eed..b9f88abab 100644--- a/frontend/src/react/pages/setup/setup-api.ts+++ b/frontend/src/react/pages/setup/setup-api.ts@@ -42,7 +42,7 @@ export interface SetupQuestions {history_guide: boolean;}-export interface SetupFact { term: string; value: string; download_url?: string; download_label?: string }+export interface SetupFact { term: string; value: string; download_url?: string; download_label?: string; install_tool?: string }export interface SetupDone {restored?: boolean;diff --git a/frontend/src/react/pages/setup/setup-done.tsx b/frontend/src/react/pages/setup/setup-done.tsxindex 95b1b1f0a..74c2e5cd5 100644--- a/frontend/src/react/pages/setup/setup-done.tsx+++ b/frontend/src/react/pages/setup/setup-done.tsx@@ -47,7 +47,9 @@ export function SetupDoneView({ done }: { done: SetupDone }) {{done.facts.map((fact) => (<Fact key={fact.term} term={fact.term}>{fact.value}- {fact.download_url+ {fact.install_tool+ ? <span className="text-text-secondary">可在配置页「应用与维护」里安装。</span>+ : fact.download_url? <ExternalLink href={fact.download_url}>{fact.download_label ?? fact.download_url}</ExternalLink>: null}</Fact>diff --git a/frontend/src/react/settings/maintenance-settings.tsx b/frontend/src/react/settings/maintenance-settings.tsxindex 6a33fac9b..795322beb 100644--- a/frontend/src/react/settings/maintenance-settings.tsx+++ b/frontend/src/react/settings/maintenance-settings.tsx@@ -36,7 +36,7 @@ export function MaintenanceSettings(<LibrarySharingSettings initial={data.library_sharing} receipt={receipt} /></div> : null}</Section> : null}- <Facts facts={data.facts} />+ <Facts facts={data.facts} receipt={receipt} /><TutorialSettings receipt={receipt} reopenTutorial={reopenTutorial} />{data.uninstall ? <UninstallSettings uninstall={data.uninstall} receipt={receipt} /> : null}</div>@@ -98,17 +98,30 @@ export function AutomaticUpdates({ initial, receipt }: { initial: AutomaticUpdat);}-function Facts({ facts }: { facts: ConfigurationFact[] }) {+/* 缺的媒体工具在能装的平台上带「安装」:下载、校验、解压都在那一次请求里做完,回来的运行信息整块+ * 替换,刚装好的那一行直接写着版本。其余平台没有发布的工具包,仍是官方下载外链。 */+function Facts({ facts: loaded, receipt }: { facts: ConfigurationFact[]; receipt(message: string): void }) {+ const [installed, setInstalled] = useState<ConfigurationFact[] | null>(null);+ const facts = installed ?? loaded;+ const action = useAction();+ const install = (tool: string) => void action.run(tool, (signal) => apiSend<{ message: string; facts: ConfigurationFact[] }>(+ '/api/configuration/media-tools', { tool }, 'POST', signal), (result) => {+ setInstalled(result.facts);+ receipt(result.message);+ });return (<Section guide="facts" title="运行信息"><FactList>- {facts.map((fact) => (- <Fact key={fact.term} term={fact.term}>- {fact.value}- {fact.download_url ? <ExternalLink href={fact.download_url}>{fact.download_label}</ExternalLink> : null}+ {facts.map(({ term, value, install_tool: tool, download_url: url, download_label: label }) => (+ <Fact key={term} term={term}>+ {value}+ {tool+ ? <Button size="small" onClick={() => install(tool)} {...busyProps(action.busy === tool)}>安装</Button>+ : url ? <ExternalLink href={url}>{label}</ExternalLink> : null}</Fact>))}</FactList>+ {action.error ? <ErrorText>{action.error}</ErrorText> : null}</Section>);}diff --git a/frontend/test/react/maintenance-settings.test.tsx b/frontend/test/react/maintenance-settings.test.tsxindex a579e9829..6d3b1bfba 100644--- a/frontend/test/react/maintenance-settings.test.tsx+++ b/frontend/test/react/maintenance-settings.test.tsx@@ -35,6 +35,26 @@ it('分区依次是运行信息、新手教程、卸载;缺依赖的运行信expect(link?.textContent).toBe('下载 FFmpeg');});+it('能装的缺失工具给「安装」,装完用服务端回的运行信息换掉那一行并回执', async () => {+ const data: ConfigurationData = {+ editable: true, notice: '', revision: 'r', media_dirs: [], library_count: 0, port: 9123,+ facts: [{ term: 'untrunc', value: '未安装;缺索引的 MP4 需要它才修得了。', install_tool: 'untrunc' }],+ };+ const fetcher = fetchMock(200, { message: '已安装 untrunc(9d86ec9)', facts: [{ term: 'untrunc', value: '已安装,版本 9d86ec9' }] });+ vi.stubGlobal('fetch', fetcher);+ const receipt = vi.fn();+ const host = await mount(<MaintenanceSettings data={data} receipt={receipt} reopenTutorial={vi.fn()} />);+ const facts = section(host, '运行信息')!;+ expect(facts.querySelector('a')).toBeNull();+ await click(buttonNamed('安装', facts));+ await settle();+ expect(fetcher.mock.calls[0]?.[0]).toBe('/api/configuration/media-tools');+ expect(sentBody(fetcher)).toEqual({ tool: 'untrunc' });+ expect(facts.querySelector('dd')?.textContent).toBe('已安装,版本 9d86ec9');+ expect(buttonNamed('安装', facts)).toBeNull();+ expect(receipt).toHaveBeenCalledWith('已安装 untrunc(9d86ec9)');+});+describe('自动更新', () => {it('两颗开关互相约束,服务端成功后才回执,关闭也能保存', async () => {const fetcher = fetchMock(200, automatic);diff --git a/src/peach/media_tools.py b/src/peach/media_tools.pynew file mode 100644index 000000000..6a63bf192--- /dev/null+++ b/src/peach/media_tools.py@@ -0,0 +1,132 @@+"""源码运行时从配置页安装 FFmpeg 与 untrunc 到数据目录的 `tools/`。++装的是独立包发布的同一份工具包 `Peach-<版本>-windows-x64-tools-<tool>.zip`,下载、两源回退、+Peach 代理、体积与 SHA-256 校验都走应用更新器那一套(`standalone_update.download`、+`signed_release`),解压沿用它的路径检查。源码运行没有更新包里的 `update-manifest.json`,+逐文件摘要取工具包自带的 `manifest.json`:整包摘要来自发布记录,包内清单随之可信。++发布只有 Windows x64 工具包:macOS 发 DMG,工具在应用包里;Linux 走 Docker 镜像,镜像自带。+这两个平台的源码运行没有可装的制品,配置页保留官方下载外链。+"""+from __future__ import annotations++import json+import os+from pathlib import Path+import platform+import re+import shutil+import uuid+import zipfile++from filelock import FileLock, Timeout+import httpx++from . import release_updates, standalone_update, update_packages++LABELS = {"ffmpeg": "FFmpeg", "untrunc": "untrunc"}+++def supported() -> bool:+ """本机能不能装发布的工具包:只有 Windows x64。"""+ return os.name == "nt" and platform.machine().lower() in {"amd64", "x86_64"}+++def installed_version(tools_root: Path, tool: str) -> str | None:+ """数据目录里那份工具包自带的版本;不是从工具包装的(没有清单)时为 None。只读清单,不算摘要。"""+ try:+ manifest = json.loads((Path(tools_root) / tool / "manifest.json").read_text(encoding="utf-8"))+ except (OSError, ValueError):+ return None+ version = manifest.get("version") if isinstance(manifest, dict) else None+ return version if isinstance(version, str) and version else None+++def _verified(folder: Path, tool: str) -> str | None:+ """`folder` 是一份完整、逐文件校验通过的工具包时返回它的版本。"""+ files = _manifest_files(folder / "manifest.json", tool, prefix="")+ if files is None or not update_packages.matches(folder, files):+ return None+ return installed_version(folder.parent, folder.name) or "未知版本"+++def _manifest_files(source, tool: str, *, prefix: str) -> dict[str, str] | None:+ """工具包清单里的逐文件摘要,键加上 `prefix`;清单缺失、格式不对或少了必需文件时为 None。"""+ try:+ text = source.read_text(encoding="utf-8") if isinstance(source, Path) else source()+ files = json.loads(text).get("files")+ except (OSError, KeyError, ValueError, AttributeError):+ return None+ if not isinstance(files, dict) or not all(+ isinstance(name, str) and isinstance(value, str) and re.fullmatch(r"[0-9a-f]{64}", value)+ for name, value in files.items()):+ return None+ required = update_packages.TOOL_PATHS[tool][1] - {"manifest.json"}+ if not required.issubset(files):+ return None+ return {prefix + name: value for name, value in files.items()}+++def install(tools_root: Path, tool: str, *, locate=release_updates.tool_package,+ fetch=standalone_update.download) -> str:+ """下载、校验并换入 `tools_root/<tool>`,返回回执。已装好且校验通过时不下载。++ 下载和解压都在 `tools_root` 下的事务目录里做,校验全过才整目录换入;中途失败只留下+ 事务目录,下次安装开头清掉,已有的那份不动。同一工具同时只装一次。+ """+ if tool not in LABELS:+ raise ValueError("未知的媒体工具")+ label = LABELS[tool]+ if not supported():+ raise ValueError(f"发布只提供 Windows x64 的 {label} 工具包,请从官方下载并加入 PATH")+ tools_root = Path(tools_root)+ tools_root.mkdir(parents=True, exist_ok=True)+ target = tools_root / tool+ lock = FileLock(str(tools_root / f".install-{tool}.lock"), thread_local=False)+ try:+ lock.acquire(timeout=0)+ except Timeout:+ raise ValueError(f"{label} 正在安装,请稍候") from None+ try:+ version = _verified(target, tool) if target.is_dir() else None+ if version is not None:+ return f"{label} 已安装({version}),无需重新下载"+ for leftover in tools_root.glob(f".install-{tool}-*"):+ shutil.rmtree(leftover, ignore_errors=True)+ work = tools_root / f".install-{tool}-{uuid.uuid4().hex[:12]}"+ work.mkdir()+ try:+ package = locate(tool)+ release = standalone_update.signed_release({"asset_url": package["url"], "asset_digest": package["digest"]})+ digest, size = standalone_update.checked_asset(release["asset_digest"], package["size"], "工具包")+ archive = work / "package.zip"+ try:+ fetch(package["url"], archive, size, digest, lambda _count: None)+ except httpx.HTTPError as exc:+ raise ValueError(f"{label} 工具包下载失败:{exc}") from exc+ except ValueError as exc:+ raise ValueError(f"{label} 工具包与发布摘要不符,已丢弃这次下载,请重试") from exc+ prefix = update_packages.TOOL_PATHS[tool][0] + "/"+ with zipfile.ZipFile(archive) as bundle:+ files = _manifest_files(lambda: bundle.read(f"Peach/{prefix}manifest.json").decode("utf-8"),+ tool, prefix=prefix)+ if files is None:+ raise ValueError(f"{label} 工具包缺少有效的文件清单")+ stage = standalone_update.extract(archive, work / "stage", lambda *_: None,+ tool_files=set(files) | {prefix + "manifest.json"})+ if not update_packages.matches(stage, files):+ raise ValueError(f"{label} 工具包文件校验失败")+ previous = work / "previous"+ if target.exists():+ os.replace(target, previous)+ try:+ os.replace(stage.joinpath(*prefix.strip("/").split("/")), target)+ except OSError:+ if previous.exists():+ os.replace(previous, target)+ raise+ finally:+ shutil.rmtree(work, ignore_errors=True)+ return f"已安装 {label}({installed_version(tools_root, tool) or package['version']})"+ finally:+ lock.release()diff --git a/src/peach/release_updates.py b/src/peach/release_updates.pyindex f88437608..2567c19ea 100644--- a/src/peach/release_updates.py+++ b/src/peach/release_updates.py@@ -79,6 +79,56 @@ def _release_candidates(rows: list, endpoint: str, system: str = "win32", machinreturn releases+def _listings(client):+ """两个公开发行源的发布列表,取不到的源跳过:逐个给出 `(endpoint, rows)`。"""+ for endpoint in (API_URL, DOWNLOADS_API):+ try:+ headers = {"Accept": "application/json"}+ if endpoint == API_URL:+ headers.update(Accept="application/vnd.github+json", **{"X-GitHub-Api-Version": "2022-11-28"})+ response = client(HttpRequest("GET", endpoint, headers), 12.0, 2_000_000)+ if response.status != 200:+ continue+ rows = json.loads(response.body)+ except (OSError, ValueError, TypeError, TimeoutError, httpx.HTTPError):+ continue+ if isinstance(rows, list):+ yield endpoint, rows+++def tool_package(tool: str, *, transport=None) -> dict:+ """最新公开版本里的 Windows 工具包 `Peach-<版本>-windows-x64-tools-<tool>.zip`。++ 源码运行的版本号不一定有同名发布(主线可能已在下一版),所以不按本机版本拼地址,+ 取两个源里最新的那份;工具包与程序版本无关,包内 `manifest.json` 自带工具版本。+ 返回 `url`、`size`、`digest`(`sha256:` 前缀)与 `version`;两个源都没有时抛 ValueError。+ """+ client = transport or HttpxTransport()+ try:+ found = []+ for endpoint, rows in _listings(client):+ for row in rows:+ version = _version(row.get("tag_name")) if isinstance(row, dict) and not row.get("draft") else None+ if version is None:+ continue+ tag = row["tag_name"]+ name = f"Peach-{tag.removeprefix('v')}-windows-x64-tools-{tool}.zip"+ asset = next((a for a in row.get("assets") or [] if isinstance(a, dict)+ and a.get("name") == name and a.get("state") == "uploaded"), None)+ if (asset is None or not re.fullmatch(r"sha256:[0-9a-f]{64}", asset.get("digest") or "")+ or not isinstance(asset.get("size"), int)):+ continue+ directory = f"{DOWNLOADS_BASE}/{tag}" if endpoint == DOWNLOADS_API else f"{RELEASES_URL}/download/{tag}"+ found.append((version, {"url": f"{directory}/{name}", "size": asset["size"],+ "digest": asset["digest"], "version": tag.removeprefix("v")}))+ if not found:+ raise ValueError("未能从发布页取得工具包信息,请检查网络与 Peach 代理后重试")+ return max(found, key=lambda item: item[0])[1]+ finally:+ if transport is None:+ client.close()++def check(*, transport=None, system: str | None = None, machine: str | None = None) -> dict:result = snapshot()system = system or sys.platform@@ -87,20 +137,11 @@ def check(*, transport=None, system: str | None = None, machine: str | None = Notry:releases = []obtained = False- for endpoint in (API_URL, DOWNLOADS_API):+ for endpoint, rows in _listings(client):+ obtained = Truetry:- headers = {"Accept": "application/json"}- if endpoint == API_URL:- headers.update(Accept="application/vnd.github+json", **{"X-GitHub-Api-Version": "2022-11-28"})- response = client(HttpRequest("GET", endpoint, headers), 12.0, 2_000_000)- if response.status != 200:- continue- rows = json.loads(response.body)- if not isinstance(rows, list):- continue- obtained = Truereleases.extend(_release_candidates(rows, endpoint, system, machine))- except (OSError, ValueError, TypeError, TimeoutError, httpx.HTTPError):+ except (ValueError, TypeError):continueif not releases:return dict(result, state="empty" if obtained else "error",diff --git a/src/peach/routes_configuration.py b/src/peach/routes_configuration.pyindex 1c3bc90b1..41831ba61 100644--- a/src/peach/routes_configuration.py+++ b/src/peach/routes_configuration.py@@ -30,7 +30,7 @@ from .jobs import JobAlreadyRunningfrom .routes_auth import require_auth, require_authenticated_client, same_origin, sessions as access_sessionsfrom .web_entry import runtime_fact_entriesfrom .web_local_access import local_client, managed_configuration-from . import release_updates, standalone_update, peach_proxy, desktop_startup, desktop_uninstall+from . import release_updates, standalone_update, peach_proxy, desktop_startup, desktop_uninstall, media_toolsrouter = APIRouter()_SAVE_LOCK = threading.Lock()@@ -414,6 +414,22 @@ def save_automatic_updates(request: Request, body: dict = Body(...), _args=Depenraise HTTPException(400, str(exc)) from exc[email protected]("/api/configuration/media-tools")+def install_media_tool(request: Request, body: dict = Body(...), _args=Depends(require_auth)):+ """把 FFmpeg 或 untrunc 装进数据目录(Windows x64,见 `media_tools`),回最新的运行信息。++ 下载在请求里同步做完:工具包几十 MB,按钮转着等,比后台任务加轮询少一整套状态。+ """+ local_only(request)+ same_origin(request)+ config = settings_file.load_config()+ try:+ message = media_tools.install(config.directory("tools"), str(body.get("tool", "")))+ except (ValueError, OSError) as exc:+ raise HTTPException(400, str(exc)) from exc+ return {"message": message, "facts": runtime_fact_entries(config)}++@router.post("/api/configuration/peach-proxy")def save_peach_proxy(request: Request, body: dict = Body(...), _args=Depends(require_auth)):local_only(request)diff --git a/src/peach/standalone_update.py b/src/peach/standalone_update.pyindex aa6335121..1cd57bb96 100644--- a/src/peach/standalone_update.py+++ b/src/peach/standalone_update.py@@ -112,14 +112,15 @@ def extract(archive: Path, destination: Path, progress, *, tool_files: set[str]def download(url: str, archive: Path, size: int, digest: str, progress) -> None:- sources = release_updates.download_sources(url)- for index, source in enumerate(sources):+ failures = []+ for source in release_updates.download_sources(url):try:_download_once(source, archive, size, digest, progress)return- except (httpx.HTTPError, ValueError):- if index == len(sources) - 1:- raise+ except (httpx.HTTPError, ValueError) as exc:+ failures.append(exc)+ # 镜像常落后几个版本:备用源的 404 不能盖住主源的校验失败,没有校验失败时报主源的原因。+ raise next((exc for exc in failures if isinstance(exc, ValueError)), failures[0])def _download_once(url: str, archive: Path, size: int, digest: str, progress) -> None:diff --git a/src/peach/web_entry.py b/src/peach/web_entry.pyindex da49760e4..68f0fffdd 100644--- a/src/peach/web_entry.py+++ b/src/peach/web_entry.py@@ -74,19 +74,42 @@ def runtime_facts(config) -> tuple[tuple[str, str], ...]:def runtime_fact_entries(config) -> list[dict[str, str]]:- """运行信息中的缺失依赖附带官方下载入口;依赖可用时不占一行。"""+ """运行信息中的缺失依赖附带入口:Windows x64 由 Peach 装进数据目录(`install_tool`),+ 其余平台没有发布的工具包,给官方下载外链。++ 依赖可用时,只有数据目录里那份占一行并写明版本,让刚装完的人看到结果;随包或 PATH 上的不占行。+ """+ from . import media_toolsfrom .ffmpeg import FFmpegResolver+ from .mp4recover import untrunc_path+ tools = config.directory("tools")+ installable = media_tools.supported()entries = [{"term": term, "value": value} for term, value in runtime_facts(config)]- resolver = FFmpegResolver(config.directory("tools") / "ffmpeg")- missing = [name for name, choice in (("FFmpeg", resolver.ffmpeg()), ("ffprobe", resolver.ffprobe()))- if choice is None]++ def installed(tool: str) -> str:+ version = media_tools.installed_version(tools, tool)+ return f"已安装,版本 {version}" if version else "已安装在数据目录"++ resolver = FFmpegResolver(tools / "ffmpeg")+ choices = {"FFmpeg": resolver.ffmpeg(), "ffprobe": resolver.ffprobe()}+ entry = next(row for row in entries if row["term"] == "FFmpeg")+ missing = [name for name, choice in choices.items() if choice is None]if missing:- entry = next(row for row in entries if row["term"] == "FFmpeg")- entry.update(value="未找到 " + "、".join(missing) + ";转码、媒体信息与缩略图需要 FFmpeg 工具包。",- download_url="https://ffmpeg.org/download.html", download_label="下载 FFmpeg")+ entry.update(value="未找到 " + "、".join(missing) + ";转码、媒体信息与缩略图需要 FFmpeg 工具包。")+ if installable:+ entry["install_tool"] = "ffmpeg"+ else:+ entry.update(download_url="https://ffmpeg.org/download.html", download_label="下载 FFmpeg")+ elif all(choice.source == "peach-managed" for choice in choices.values()):+ entry["value"] = installed("ffmpeg")untrunc = next(row for row in entries if row["term"] == "untrunc")- if untrunc["value"] != "可用":- untrunc.update(value=untrunc["value"] + f"解压到 {config.directory('tools') / 'untrunc'}。",+ path = untrunc_path(tools)+ if path is None and installable:+ untrunc["install_tool"] = "untrunc"+ elif path is None:+ untrunc.update(value=untrunc["value"] + f"解压到 {tools / 'untrunc'}。",download_url="https://github.com/anthwlock/untrunc/releases",download_label="下载 untrunc")+ elif path.parent == (tools / "untrunc").resolve():+ untrunc["value"] = installed("untrunc")return [row for row in entries if not (row["term"] in ("FFmpeg", "untrunc") and row["value"] == "可用")]diff --git a/tests/test_configuration_sources.py b/tests/test_configuration_sources.pyindex 81e5e6a55..9f10f2223 100644--- a/tests/test_configuration_sources.py+++ b/tests/test_configuration_sources.py@@ -268,21 +268,35 @@ class MediaConfigurationTests(unittest.TestCase):def test_runtime_fact_entries_list_dependencies_only_when_missing(self):from peach import web_entry+ from peach.ffmpeg import BinaryChoicewith tempfile.TemporaryDirectory() as directory:config = settings_file.load_config(environ={"PEACH_DATA_ROOT": str(Path(directory).resolve())})- with patch("peach.ffmpeg.FFmpegResolver.ffmpeg", return_value=Path("ffmpeg")), \- patch("peach.ffmpeg.FFmpegResolver.ffprobe", return_value=Path("ffprobe")), \- patch("peach.mp4recover.untrunc_path", return_value=Path("untrunc")):- present = [row["term"] for row in web_entry.runtime_fact_entries(config)]- with patch("peach.ffmpeg.FFmpegResolver.ffmpeg", return_value=None), \- patch("peach.ffmpeg.FFmpegResolver.ffprobe", return_value=None), \- patch("peach.mp4recover.untrunc_path", return_value=None):- missing = {row["term"]: row for row in web_entry.runtime_fact_entries(config)}++ def facts(choice, untrunc, *, installable):+ with patch("peach.ffmpeg.FFmpegResolver.ffmpeg", return_value=choice), \+ patch("peach.ffmpeg.FFmpegResolver.ffprobe", return_value=choice), \+ patch("peach.mp4recover.untrunc_path", return_value=untrunc), \+ patch("peach.media_tools.supported", return_value=installable):+ return {row["term"]: row for row in web_entry.runtime_fact_entries(config)}++ present = facts(BinaryChoice(Path("ffmpeg"), "path"), Path("untrunc"), installable=True)+ missing = facts(None, None, installable=False)+ installable = facts(None, None, installable=True)+ tools = config.directory("tools")+ (tools / "ffmpeg").mkdir(parents=True)+ (tools / "ffmpeg" / "manifest.json").write_text('{"version": "9.0.2"}', encoding="utf-8")+ managed = facts(BinaryChoice(tools / "ffmpeg" / "bin" / "ffmpeg.exe", "peach-managed"),+ (tools / "untrunc" / "untrunc.exe").resolve(), installable=True)self.assertNotIn("FFmpeg", present)self.assertNotIn("untrunc", present)self.assertIn("版本", present)self.assertEqual(missing["FFmpeg"]["download_label"], "下载 FFmpeg")self.assertEqual(missing["untrunc"]["download_label"], "下载 untrunc")+ self.assertEqual({term: (row.get("install_tool"), "download_url" in row) for term, row in installable.items()+ if term in ("FFmpeg", "untrunc")},+ {"FFmpeg": ("ffmpeg", False), "untrunc": ("untrunc", False)})+ self.assertEqual(managed["FFmpeg"]["value"], "已安装,版本 9.0.2")+ self.assertEqual(managed["untrunc"]["value"], "已安装在数据目录")def test_windows_cloud_sources_keep_policy_ids_and_offline_roots(self):roots, mounts, errors = media_config.validate([diff --git a/tests/test_release_updates.py b/tests/test_release_updates.pyindex c5ff5f3a3..a25d4af25 100644--- a/tests/test_release_updates.py+++ b/tests/test_release_updates.py@@ -131,6 +131,26 @@ class ReleaseUpdateTests(unittest.TestCase):self.assertEqual(calls, [release_updates.API_URL, release_updates.DOWNLOADS_API])self.assertEqual(result["asset_url"], release_updates.RELEASES_URL + "/download/v1.0.0/Peach-1.0.0-windows-x64.zip")+ def test_tool_package_is_the_newest_release_carrying_that_tool_with_a_digest(self):+ def tools(version, digest=True):+ row = release(version)+ row["assets"].append({"name": f"Peach-{version}-windows-x64-tools-ffmpeg.zip", "state": "uploaded",+ "size": 42, **({"digest": "sha256:" + "b" * 64} if digest else {})})+ return row++ github = [tools("2.0.0", digest=False), tools("1.5.0"), release("3.0.0")]+ mirror = [tools("1.0.0")]++ def transport(request, *_args):+ rows = mirror if request.url == release_updates.DOWNLOADS_API else github+ return HttpResponse(200, {}, json.dumps(rows).encode())++ self.assertEqual(release_updates.tool_package("ffmpeg", transport=transport), {+ "url": release_updates.RELEASES_URL + "/download/v1.5.0/Peach-1.5.0-windows-x64-tools-ffmpeg.zip",+ "size": 42, "digest": "sha256:" + "b" * 64, "version": "1.5.0"})+ with self.assertRaisesRegex(ValueError, "工具包"):+ release_updates.tool_package("untrunc", transport=transport)+def test_standalone_tray_checks_releases_without_git(self):execute = Mock(side_effect=AssertionError("Git must not run"))with patch("peach.distribution.standalone", return_value=True), patch.object(diff --git a/tests/test_standalone_update.py b/tests/test_standalone_update.pyindex 7891928cd..1e4456ae3 100644--- a/tests/test_standalone_update.py+++ b/tests/test_standalone_update.py@@ -66,6 +66,95 @@ class ReleaseDownloadFailoverTests(unittest.TestCase):Path(folder).resolve() / 'package.zip', 3, hashlib.sha256(b'yes').hexdigest(), lambda _count: None)self.assertEqual(len(calls), 2)+ def test_a_lagging_mirror_does_not_hide_why_the_primary_source_failed(self):+ github = 'https://github.com/peach-mitao/peach/releases/download/v1.0.0/Peach-1.0.0-windows-x64.zip'++ def client(primary, **_kwargs):+ return httpx.Client(transport=httpx.MockTransport(+ lambda request: primary if str(request.url) == github else httpx.Response(404)))++ for primary, expected in ((httpx.Response(200, content=b'bad'), '校验失败'),+ (httpx.Response(503), '503')):+ with self.subTest(expected=expected), tempfile.TemporaryDirectory() as folder, \+ patch('peach.peach_proxy.http_client', side_effect=lambda primary=primary, **kw: client(primary, **kw)):+ with self.assertRaisesRegex((ValueError, httpx.HTTPError), expected):+ update.download(github, Path(folder).resolve() / 'package.zip', 3,+ hashlib.sha256(b'yes').hexdigest(), lambda _count: None)+++class MediaToolInstallTests(unittest.TestCase):+ """源码运行在配置页安装 FFmpeg、untrunc:发布工具包装进数据目录的 `tools/`。"""++ def setUp(self):+ temp = tempfile.TemporaryDirectory()+ self.addCleanup(temp.cleanup)+ self.root = Path(temp.name).resolve()+ self.tools = self.root / 'data' / 'tools'+ self.package = self.root / 'release' / 'Peach-1.0.0-windows-x64-tools-untrunc.zip'+ self.package.parent.mkdir()+ files = {name: f'{name} 内容'.encode() for name in ('untrunc.exe', 'LICENSE.txt', 'NOTICE.md', 'buildconf.txt')}+ manifest = {'version': 'abc1234', 'files': {name: hashlib.sha256(body).hexdigest() for name, body in files.items()}}+ with zipfile.ZipFile(self.package, 'w') as bundle:+ for name, body in {**files, 'manifest.json': json.dumps(manifest).encode()}.items():+ bundle.writestr(f'Peach/tools/untrunc/{name}', body)+ self.downloads = []+ supported = patch('peach.media_tools.supported', return_value=True)+ supported.start()+ self.addCleanup(supported.stop)++ def locate(self, _tool, digest=None):+ return {'url': 'https://github.com/peach-mitao/peach/releases/download/v1.0.0/' + self.package.name,+ 'size': self.package.stat().st_size, 'version': '1.0.0',+ 'digest': 'sha256:' + (digest or update_packages.digest(self.package))}++ def fetch(self, url, archive, size, digest, progress):+ """离线的 `standalone_update.download`:同样按发布记录核对体积与摘要。"""+ self.downloads.append(url)+ shutil.copy2(self.package, archive)+ if archive.stat().st_size != size or update_packages.digest(archive) != digest:+ raise ValueError('更新包校验失败,请重新下载')++ def install(self, **kwargs):+ from peach import media_tools+ return media_tools.install(self.tools, 'untrunc', locate=kwargs.pop('locate', self.locate), fetch=self.fetch)++ def test_installs_the_verified_package_into_the_data_directory_and_reports_its_version(self):+ from peach import media_tools+ self.assertEqual(self.install(), '已安装 untrunc(abc1234)')+ self.assertEqual((self.tools / 'untrunc' / 'untrunc.exe').read_bytes(), 'untrunc.exe 内容'.encode())+ self.assertEqual(media_tools.installed_version(self.tools, 'untrunc'), 'abc1234')+ self.assertEqual(sorted(path.name for path in self.tools.iterdir()), ['untrunc'])++ def test_a_package_that_does_not_match_the_release_digest_changes_nothing(self):+ (self.tools / 'untrunc').mkdir(parents=True)+ (self.tools / 'untrunc' / 'untrunc.exe').write_bytes(b'user copy')+ with self.assertRaisesRegex(ValueError, '与发布摘要不符'):+ self.install(locate=lambda tool: self.locate(tool, digest='0' * 64))+ self.assertEqual((self.tools / 'untrunc' / 'untrunc.exe').read_bytes(), b'user copy')+ self.assertEqual(sorted(path.name for path in self.tools.iterdir()), ['untrunc'])++ def test_installing_again_skips_the_download_until_a_file_stops_matching(self):+ self.install()+ self.assertEqual(self.install(), 'untrunc 已安装(abc1234),无需重新下载')+ self.assertEqual(len(self.downloads), 1)+ (self.tools / 'untrunc' / 'NOTICE.md').write_text('改坏了', encoding='utf-8')+ self.assertEqual(self.install(), '已安装 untrunc(abc1234)')+ self.assertEqual(len(self.downloads), 2)++ def test_an_interrupted_install_is_cleared_by_the_next_one(self):+ leftover = self.tools / '.install-untrunc-0123456789ab'+ leftover.mkdir(parents=True)+ (leftover / 'package.zip').write_bytes(b'half')+ self.install()+ self.assertEqual(sorted(path.name for path in self.tools.iterdir()), ['untrunc'])++ def test_files_outside_the_package_manifest_are_refused(self):+ with zipfile.ZipFile(self.package, 'a') as bundle:+ bundle.writestr('Peach/tools/untrunc/extra.dll', b'x')+ with self.assertRaisesRegex(ValueError, '清单外'):+ self.install()+ self.assertFalse((self.tools / 'untrunc').exists())+class StandaloneUpdateTests(unittest.TestCase):def setUp(self):diff --git a/web/dist/peach-app.configuration-page-ubxQHJd0.js b/web/dist/peach-app.configuration-page-ZtgXPBdL.jssimilarity index 99%rename from web/dist/peach-app.configuration-page-ubxQHJd0.jsrename to web/dist/peach-app.configuration-page-ZtgXPBdL.jsindex 9aa994664..49277c0f0 100644--- a/web/dist/peach-app.configuration-page-ubxQHJd0.js+++ b/web/dist/peach-app.configuration-page-ZtgXPBdL.js@@ -1,7 +1,7 @@(function() {try {var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "80caf3f2-9a7b-4fda-9c35-03d51996f275", e._sentryDebugIdIdentifier = "sentry-dbid-80caf3f2-9a7b-4fda-9c35-03d51996f275");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "2f3cd5a5-f56d-4330-99e5-239a1b564c28", e._sentryDebugIdIdentifier = "sentry-dbid-2f3cd5a5-f56d-4330-99e5-239a1b564c28");} catch {}})();import { AnimatedItems as e, Cell as t, ChartBackground as n, ChartContainer as r, ChartLegend as i, ChartLegendContent as a, ChartTip as o, ChartTooltip as s, ChartTooltipContent as c, Curve as l, DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME as u, DATA_ITEM_INDEX_ATTRIBUTE_NAME as d, DefaultZIndexes as f, EvilBarChart as p, LabelList as m, LabelListFromLabelProp as h, Layer as g, LoadingIndicator as _, PolarChart as v, PolarLabelContextProvider as y, PolarLabelListContextProvider as b, RegisterGraphicalItemId as x, Sector as S, SetPolarGraphicalItem as C, SetPolarLegendPayload as w, SetTooltipEntrySettings as T, Shape as ee, TIP_SWATCH as te, Text as ne, ZIndexLayer as re, adaptEventsOfChild as ie, arrayTooltipSearcher as ae, createSelector as oe, defaultPolarChartProps as se, findAllByType as ce, get as le, getClassNameFromUnknown as ue, getColorsCount as de, getMaxRadius as fe, getPercentValue as pe, getTooltipNameProp as me, getValueByDataKey as he, interpolate as ge, isNumber as _e, matchAppend as ve, mathSign as ye, polarToCartesian as be, resolveDefaultProps as xe, selectActiveTooltipDataKey as Se, selectActiveTooltipGraphicalItemId as Ce, selectActiveTooltipIndex as we, selectChartDataAndAlwaysIgnoreIndexes as Te, selectChartOffsetInternal as Ee, selectUnfilteredPolarItems as De, svgPropertiesNoEvents as Oe, svgPropertiesNoEventsFromUnknown as ke, tone as Ae, useAnimationCallbacks as je, useAppSelector as Me, useMouseClickItemDispatch as Ne, useMouseEnterItemDispatch as Pe, useMouseLeaveItemDispatch as Fe, usePolarChartLayout as Ie } from "./peach-app.chart-tip-CRxYp6KT.js";@@ -2204,7 +2204,10 @@ function wa({ data: e, receipt: t, reopenTutorial: n, panel: r }) {})}) : null]}) : null,- /* @__PURE__ */ (0, Q.jsx)(Da, { facts: e.facts }),+ /* @__PURE__ */ (0, Q.jsx)(Da, {+ facts: e.facts,+ receipt: t+ }),/* @__PURE__ */ (0, Q.jsx)(Ta, {receipt: t,reopenTutorial: n@@ -2294,17 +2297,25 @@ function Ea({ initial: e, receipt: t }) {]});}-function Da({ facts: e }) {- return /* @__PURE__ */ (0, Q.jsx)(L, {+function Da({ facts: e, receipt: t }) {+ let [n, r] = (0, Z.useState)(null), i = n ?? e, a = Y(), o = (e) => void a.run(e, (t) => G("/api/configuration/media-tools", { tool: e }, "POST", t), (e) => {+ r(e.facts), t(e.message);+ });+ return /* @__PURE__ */ (0, Q.jsxs)(L, {guide: "facts",title: "运行信息",- children: /* @__PURE__ */ (0, Q.jsx)(lt, { children: e.map((e) => /* @__PURE__ */ (0, Q.jsxs)(j, {- term: e.term,- children: [e.value, e.download_url ? /* @__PURE__ */ (0, Q.jsx)(A, {- href: e.download_url,- children: e.download_label+ children: [/* @__PURE__ */ (0, Q.jsx)(lt, { children: i.map(({ term: e, value: t, install_tool: n, download_url: r, download_label: i }) => /* @__PURE__ */ (0, Q.jsxs)(j, {+ term: e,+ children: [t, n ? /* @__PURE__ */ (0, Q.jsx)(E, {+ size: "small",+ onClick: () => o(n),+ ...K(a.busy === n),+ children: "安装"+ }) : r ? /* @__PURE__ */ (0, Q.jsx)(A, {+ href: r,+ children: i}) : null]- }, e.term)) })+ }, e)) }), a.error ? /* @__PURE__ */ (0, Q.jsx)(k, { children: a.error }) : null]});}function Oa({ uninstall: e, receipt: t }) {@@ -5820,4 +5831,4 @@ function Ps({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i}export { js as ConfigurationPage };-//# debugId=80caf3f2-9a7b-4fda-9c35-03d51996f275\ No newline at end of file+//# debugId=2f3cd5a5-f56d-4330-99e5-239a1b564c28\ No newline at end of filediff --git a/web/dist/peach-app.js b/web/dist/peach-app.jsindex 1c95481ff..8f954192b 100644--- a/web/dist/peach-app.js+++ b/web/dist/peach-app.js@@ -2,7 +2,7 @@(function() {try {var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f801708c-39a2-426c-b8b8-125b72b1203f", e._sentryDebugIdIdentifier = "sentry-dbid-f801708c-39a2-426c-b8b8-125b72b1203f");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "2e6b93a0-ea13-4213-bb53-e27291e2f849", e._sentryDebugIdIdentifier = "sentry-dbid-2e6b93a0-ea13-4213-bb53-e27291e2f849");} catch {}})();var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {@@ -79351,7 +79351,7 @@ async function T6(e, t) {if (n.status === "rejected") throw n.reason;}var E6 = w6(() => import("./peach-app.jav-page-CvsnSwyE.js")), D6 = w6(() => import("./peach-app.stats-page-Domc7MK7.js")), O6 = w6(() => import("./peach-app.taste-page-DBsNS6-3.js")), k6 = w6(() => import("./peach-app.review-page-DL1KGdJQ.js")), A6 = w6(() => import("./peach-app.data-cleanup-page-CZOBqkVd.js")), j6 = w6(() => import("./peach-app.duplicates-page-Bau8HIlx.js")), M6 = w6(() => import("./peach-app.quality-goals-page-Deoy7rhD.js")), N6 = w6(() => import("./peach-app.scraping-page-C4xFEKWF.js")), P6 = w6(async () => {- let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-ubxQHJd0.js"), import("./peach-app.diagnostics-page-DS1L_wLs.js")]);+ let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-ZtgXPBdL.js"), import("./peach-app.diagnostics-page-DS1L_wLs.js")]);return {ConfigurationPage: e,DiagnosticsPage: t@@ -84597,4 +84597,4 @@ if (!$9) throw Error("主界面宿主缺失");BBe($9);export { BL as $2ec61d1d4f780267$export$a8a3e93435678ff9, JL as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, dz as $542a13ca2fa5b484$export$5b6b19405a83ff9d, wD as $72abaeab4d80592f$export$78efe591171d7d45, rB as $76d00c5a4edb230a$export$76ccd210b9029917, eB as $76d00c5a4edb230a$export$816b5d811295e6bc, oB as $76d00c5a4edb230a$export$b59bdbef9ce70de2, cB as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, $z as $76d00c5a4edb230a$export$f850895b287ef28e, Uhe as $b4f18e3395fe64d7$export$3d96ec278d3efce4, Hhe as $b4f18e3395fe64d7$export$3e41faf802a29e71, zhe as $b4f18e3395fe64d7$export$b2539bed5023c21c, fB as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, Khe as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, dE as $ea3928288112382f$export$439d29a4e110a164, wz as $f2ff30fde7b014be$export$3ddf2d174ce01153, jz as $fe21c36db05242bb$export$a98f0dcb43a68a25, Mz as $fe21c36db05242bb$export$d7b12c4107be0d61, kge as $l, Uj as ACCENTS, IAe as AMANE_BRIDGE_CHECK_URL, M$ as AMANE_BRIDGE_KEY, LAe as AMANE_BRIDGE_REBUILD_URL, sr as ApiError, KU as ArtSlot, S2 as BATCH_DELETE_TEXT, J as Button, vL as ButtonLink, WB as Bx, s$ as CLEANUP_ENTRY, o$ as CLEANUP_ENTRY_GRID, Zf as CLEANUP_HASH_REDIRECTS, Yf as CLEANUP_TOOLS, vn as CLOUD_LOCATIONS, J1 as CLOUD_PROXY_HELP, Kr as COLUMN_SORT, Y$ as CONFIGURATION_KEY, HY as CONFIGURATION_URL, RAe as COOKIE_TEXT_LIMIT, j$ as COVER_JOB_KEY, Yi as CREDENTIAL_STATE, D$ as CUSTOM_SOURCES_KEY, E$ as CUSTOM_SOURCES_URL, oG as CatalogViewToggle, RV as Checkbox, LV as CheckboxGlyph, OV as ChevronSortDown, GU as Chip, tW as CloudDownloadDialog, MH as CollapseChevron, jH as CollapseRegion, e$ as CollectionSummary, mTe as DEFAULT_CATEGORY, dr as DEFAULT_SORT, EQ as DIAGNOSTICS_KEY, mEe as DIRECTORY_TEMPLATE_ERROR, cW as DISCOVERY_SORTS, JU as DOWNLOADS_KEY, qU as DOWNLOADS_URL, cY as DUPLICATES_KEY, HJ as DataTableFooter, RJ as DataTableFrame, VJ as DataTableSort, RH as Disclosure, wye as DownloadsPanel, vge as E3, hTe as ENTITY_REVIEW_KINDS, K1 as ENTRY_LINKS_HELP, q1 as ENTRY_LINKS_HINT, IB as Ea, n_e as EmptyFocusButton, uV as EmptyState, IH as ErrorText, Kge as Eu, vve as ExternalLink, Vr as FEEDS_KEY, XY as FEED_SCHEDULE_KEY, i$ as FIELDSET_FOOT, pIe as FLOW_LABEL_X, n6 as FLOW_VIEWBOX, zr as FOLLOW_CHECK_KEY, Rr as FOLLOW_CREDENTIALS_KEY, z8 as FOLLOW_INITIAL_RANGE_OPTIONS, Lr as FOLLOW_MANAGE_KEY, kZ as FOLLOW_MANAGE_NAV, Br as FOLLOW_RESOLVE_KEY, YY as FOLLOW_SCHEDULE_KEY, xve as Fact, bve as FactList, LH as FieldLabel, _$ as Fieldset, g$ as FieldsetTitle, Bpe as FilterGlass, dL as FilterGlassRows, uL as FilterIconButton, fL as FilterPill, _ve as Footer, VB as Gg, pL as GlassPill, JB as HN, FH as Help, tV as HintText, aIe as IDLE_POLL_MS, rTe as IDLE_REPAIR, oL as IconButton, OQ as IndexSearch, oV as Input, aV as InputBase, y$ as IssueRow, sM as JAV_LAYOUTS, V0 as JAV_RECOMMENDATION_GRID, bX as JUNK_KEY, _W as JavHeader, Zwe as KEEP_LABELS, cge as L1, Ur as LAYOUTS, G1 as LIBRARY_FOLDER_HELP, ZV as LIBRARY_PROCESSING_KEY, PY as LINKS_KEY, FY as LINK_CHECK_KEY, zTe as LINK_KINDS, IY as LINK_PRUNE_KEY, nr as LOC, eV as Label, S$ as LibraryProcessingCard, DV as LibraryShortcuts, pH as LinkButton, jge as Lo, EH as LoadingDots, bge as M6, GTe as MEDIA_PROCESSING_KEY, WTe as MEDIA_PROCESSING_URL, pY as MEDIA_REPAIR_KEY, fY as MEDIA_REPAIR_URL, yr as MEDIA_SOURCES_KEY, _s as MEDIA_SOURCE_ICONS, gn as MEDIA_SOURCE_OPTIONS, MV as MENU_ITEM, NV as MENU_ITEM_INTERACTIVE, jV as MENU_POPOVER_SURFACE, Nge as Ma, _H as MenuDialog, gK as MixCard, sV as ModalFrame, Sx as MotionConfigContext, QB as NR, v$ as NameLink, lV as Note, Qge as OA, eX as ORGANIZE_KEY, y2 as ORGANIZE_PARAMETER_HINT, v2 as ORGANIZE_SCOPE_HINT, _2 as ORGANIZE_TEXT, rX as ORPHAN_RECORDS_KEY, x2 as ORPHAN_RECORDS_TEXT, zB as OV, wB as P7, _X as PERFORMER_DELETE_KEY, Nye as PHASES, UY as PICK_FOLDER_URL, l$ as PLAIN_STAT_STRIP, w$ as PLAYLISTS_KEY, eMe as POLICY_COLUMNS, nMe as POLICY_COVER_NOTE, tMe as POLICY_MATRIX, W1 as POLICY_SUMMARY, BJ as Pagination, x$ as PathLine, XB as Pf, FI as PillTabList, iAe as PlainStat, OH as Progress, vY as QUALITY_GOALS_KEY, YB as RB, R0 as RELEASE_COLUMN_VISIBILITY_KEY, L0 as RELEASE_COLUMN_WIDTHS_KEY, lW as RELEASE_SORTS, AMe as RELEASE_SORT_COLUMNS, d$ as REPAIR_CARD_TEXT, mY as REPAIR_LIBRARIES_KEY, cX as RESOURCE_APPLY_KEY, sX as RESOURCE_SCAN_KEY, b2 as RESOURCE_SYNC_TEXT, uAe as RESULT_PANEL, dAe as RESULT_SECTION, pTe as REVIEW_CATEGORIES, yX as REVIEW_COUNTS_KEY, gTe as REVIEW_DECISION_LABELS, xY as REVIEW_KEY, SY as REVIEW_LABELS, wY as REVIEW_QUEUES, TY as REVIEW_QUEUE_LABELS, LG as RetryNote, Xge as Rf, $B as Rk, mve as Rows, PAe as SCRAPING_CHECK_URL, k$ as SCRAPING_COVER_URL, A$ as SCRAPING_KEY, NAe as SCRAPING_SETTINGS_URL, iU as SEGMENT, rU as SEGMENTED_TRACK, JY as SETTINGS_KEY, WY as SETTINGS_URL, fr as SORT_DEFAULT_DIR, ur as SORT_OPTIONS, yn as SOURCE_LABELS, D3 as STATS_KEY, nAe as STAT_STRIP, rAe as STAT_STRIP_SIX, pve as Section, fAe as SectionHeading, gve as SectionSkeleton, nU as SegmentedRadioGroup, Ive as SegmentedTabList, AG as Segments, zJ as Select, HU as Select$1, $$ as SelectField, UU as SelectItem, YJ as SelectionActions, xj as SelectionDock, XJ as SelectionPopover, NH as SettingsCard, fve as SettingsRow, PH as SettingsSectionLabel, jG as Shuffle, Tve as SiteLabel, cG as SortDirectionIcon, MG as SortKeys, lQ as SourceAvatar, HH as SourceLabel, zH as SourceMark, hve as Stack, aAe as StatCard, b$ as StatusLabel, qge as Su, a4 as Switch, WI as TASKS_KEY, JFe as TASTE_REFRESH_KEY, YFe as TASTE_WINDOWS, ZY as THUMBNAIL_JOBS_KEY, SX as TRASH_KEY, ype as TRIGGER_LABELS, DJ as Table, ZJ as TableColumnControls, QJ as TableColumnResizer, eY as TableSelectionHeader, YQ as TagManager, yve as TaskCenterLink, kH as TaskProgress, rV as TextField, nV as TextFieldContext, LB as Un, Zge as Uz, rW as WANTS_KEY, b4 as WantMagnets, Yg as WithPromise, OB as Wt, FB as Xc, ZB as Xf, AB as Xl, kB as Xt, EB as _8, o as __commonJSMin, s as __exportAll, l as __toESM, qB as _p, Yge as aB, Ei as addAlias, Ti as addSource, aW as addWant, dS as animate, B as apiGet, V as apiSend, tM as appSettingsStore, NEe as applyConfirmText, gX as applyLeftovers, MEe as applyPlanText, FEe as applyText, aM as applyTheme, by as asNumber, xEe as attachOrphan, ci as authorAvatar, ui as authorGroups, si as authorInitial, oi as authorName, hq as autoResetPageIndex, _o as avatarInner, N3 as bandRows, hEe as baseName, nTe as batchOperate, Fue as beginPlayerGuidePreview, Ej as boundedPreference, $we as bulkCloudPreferences, mV as busyProps, Jge as cB, CPe as cachedMagnetStates, Ug as calcGeneratorVelocity, CTe as canApprove, vg as cancelFrame, EEe as candidateText, SU as cardClass, bM as cardRatio, FJ as catalogListSkeletonCellHtml, PB as cc, Gi as checkEvidenceGap, Wi as checkFailures, Fi as checkFeeds, UTe as checkLine, Hi as checkReceipt, Ui as checkSummary, BAe as checkText, Ki as checkedText, rK as clickedBlank, Q5 as closeDrawerAfterNav, Gwe as cloudLocations, T0 as cloudProxySkeleton, WC as clsx, Ige as cn, lv as collectMotionValues, Fq as columnVisibilityFeature, SJ as column_getCanSort, vJ as column_getSortFn, xTe as commonReviewSources, eW as composingKey, Af as configurationSection, $Fe as configureTasteBrowser, ll as confirmModal, _pe as controlTask, ZK as copyInstancePropertiesWithoutMemos, lo as coverUrl, Eq as createColumnHelper, DAe as createPlaylist, Xi as credentialDone, x0 as credentialsSkeleton, MTe as currentReviewRow, q as cx, xge as d6, UB as dZ, kTe as decisionPayload, ATe as decisionReceipt, OTe as defaultChoice, LEe as deletePerformerVideos, kAe as deletePlaylist, k0 as devicesSkeleton, x as diagnosticHeaders, U1 as diagnosticsSkeleton, Hye as discoveryArtwork, uW as discoveryKey, zye as discoveryScore, d9 as disposeStage, Ywe as distinctName, Bi as dropSources, Gge as du, eTe as duplicateVictims, ZI as elapsedText, nn as entityDisplayName, go as entityFaceImg, Pn as entityPath, ti as errorHeadline, lr as errorMessage, z as esc, mq as expandRowModel, _B as f1, bo as facePos, ei as feedIntervalText, F$ as fetchAmaneBridge, vi as fetchCheckJob, X$ as fetchConfiguration, P$ as fetchCoverJob, _i as fetchCredentials, O$ as fetchCustomSources, vX as fetchDeletePerformers, IEe as fetchDeletePlan, DQ as fetchDiagnostics, dW as fetchDiscoveries, uY as fetchDuplicates, ppe as fetchEarlier, JTe as fetchFeedSchedule, Mi as fetchFeeds, gi as fetchFollow, qTe as fetchFollowSchedule, wX as fetchJunkSummary, aH as fetchLibraryProcessing, zY as fetchLinkCheck, BY as fetchLinkPrune, RY as fetchLinkStats, KTe as fetchMediaProcessing, hY as fetchMediaRepair, br as fetchMediaSources, tX as fetchOrganize, sEe as fetchOrganizeExample, iX as fetchOrphanRecords, ji as fetchPending, T$ as fetchPlaylists, yY as fetchQualityGoals, mW as fetchReleases, gY as fetchRepairLibraries, yi as fetchResolveJob, uX as fetchResourceApply, lX as fetchResourceScan, jY as fetchReview, CX as fetchReviewCounts, QY as fetchSettings, N$ as fetchSources, O3 as fetchStats, bi as fetchSuggestions, KI as fetchTasks, $3 as fetchTaste, eIe as fetchTasteJob, YTe as fetchThumbnailJobs, TX as fetchTrashSummary, iW as fetchWants, yTe as filterReviewRows, er as firstGrapheme, NK as flexRender, hIe as flowGraph, gIe as flowLabel, mFe as fmtCount, Jn as fmtDur, Xn as fmtSize, fpe as foldByKind, kpe as foldRoutine, Li as followFeedByName, Hr as followSuggestKey, jpe as followupDetail, dpe as followupTally, _g as frame, SB as g4, Rq as getDefaultPaginationState, yM as gridLayout, li as groupByAuthor, Ope as groupFollowups, OY as groupReviewRows, AEe as hasChanges, dX as hasResourceRoots, JI as hasResultProblems, oIe as historySpan, vB as i2, iIe as importTasteExport, S0 as indexersSkeleton, zg as interpolate, sW as invalidateWants, XI as isActive, $r as isBroken, qr as isLayout, bv as isMotionValue, CY as isReviewCategory, Ape as isRoutine, C0 as javBrowserSkeleton, U0 as javContentSkeleton, fM as javLayout, H0 as javTagSkeleton, HEe as junkBreakdown, AAe as keepPlaylist, ke as keepPreviousData, pi as keepSelected, k3 as known, sge as l1, mge as l7, Dpe as latestOfKind, $n as leadingGraphemes, EFe as lengthRows, Cr as localTime, po as logoUrl, Ii as lookupFeedActor, CB as m7, HB as mM, Dn as mapLimit, Ai as markItem, P3 as max, wFe as mediumRows, mpe as mergeFinished, F3 as min, LTe as mirrorText, oTe as missingToolText, dY as mixedCloudPreferences, tL as momentText, fS as motion, dv as motionValue, rn as nameFallback, Ue as notifyManager, Sge as oe, _Ee as organizeOutcome, a2 as overlayHost, Jr as pageSizeOf, fi as pageWindow, hr as paginationRange, zi as patchSource, Np as peachHistory, Np as peachHistory$1, DTe as pendingGenres, gFe as percentText, uEe as pickOrganizeFolder, c$ as plainStatClass, gEe as planSummary, A3 as playedFor, vFe as playedItemUrl, GI as pollInterval, Ys as popCount, EAe as posterUrl, hxe as previewLibraryColor, lEe as previewOrganize, lTe as previewUrl, Tpe as problemDestination, eH as processingActive, QI as progressText, VH as providerIcon, HTe as pruneText, pX as purgeCount, SEe as purgeOrphan, GB as pv, Wge as qE, H as queryClient, yB as r2, fIe as radarRows, xFe as radialArc, SFe as radialBarSize, bFe as radialCeiling, yFe as radialSlices, IN as randomId, uIe as rankDetail, dIe as rankShares, M3 as reachedShare, $I as readableErrorHeadline, Bye as recommendationScore, NTe as recordGenre, wEe as recordsText, jAe as recreatePlaylist, wAe as refreshPlaylists, El as relayoutCovers, z0 as releaseColumns, fW as releaseFilters, pW as releaseKey, Vi as reloadFollowManage, ITe as reloadReview, aMe as rememberShape, fEe as rememberTemplates, Di as removeAlias, Pi as removeFeed, wi as removeSource, rIe as removeTasteSource, oW as removeWants, Oi as renameAliasGroup, OAe as renamePlaylist, Se as replaceEqualDeep, OFe as replayRows, re as require_jsx_runtime, A as require_react, N as require_react_dom, qK as require_with_selector, Iye as resetWants, mr as resolveFollowSort, Kg as resolveStartTime, J_e as restartEffectText, TAe as resumeAssetId, vTe as reviewGroupingOptions, DY as reviewQueueData, EY as reviewQueueOf, VEe as reviewSummary, bTe as reviewWindow, TTe as rowEvidence, AY as rowFieldName, Gq as rowPaginationFeature, fJ as rowSelectionFeature, TJ as rowSortingFeature, kY as rowSubject, ETe as rowTags, wTe as rowTitle, dge as s5, ki as saveCredential, jEe as scanLine, eEe as schedulePollInterval, Rye as searchNote, STe as selectReviewRange, mi as selectionState, Ni as setFeedEnabled, Ci as setSourceEnabled, Pf as settingsPath, FTe as settleReviewRows, Jwe as sharedNamePrefix, Pp as shellNavigate, D8 as showToast, Bn as siteMarkUrl, aq as skipFirstRun, NI as sortCx, Xr as sortLabel, bn as sourceDefaultCost, Ji as sourceIconUrl, PEe as sourceMeta, Bs as spinnerHtml, Lg as spring, fV as spriteGlyph, xi as startCheck, BTe as startLinkCheck, VTe as startLinkPrune, dEe as startOrganize, Si as startResolve, OEe as startResourceApply, DEe as startResourceScan, nIe as startTasteRefresh, tAe as statCardClass, xpe as statusLabel, aTe as statusLine, Qr as statusText, xM as storeJavLayout, jTe as submitDecision, nL as summaryItems, Dq as tableFeatures, oq as tableMemo, di as tableRows, wpe as taskIssues, Epe as taskSubject, e6 as tasteDate, cIe as tasteDimensions, sIe as tasteHours, Q3 as tasteKey, ZFe as tasteRefetchInterval, QFe as tasteTime, zI as textLang, I0 as tierPlaceholdersHtml, ch as time, Dge as tl, hi as toggleGroup, t6 as topScores, Rge as um, Mge as uo, mH as useAction, wZ as useBackgroundJob, aG as useCatalogView, PU as useClientUpdates, bm as useConstant, rL as useEntityNames, lL as useHorizontalScroller, xm as useIsomorphicLayoutEffect, nK as useLibraryTints, It as useMutation, zV as useOverlayScrollbar, Ft as useQuery, ae as useQueryClient, eS as useReducedMotion, $Te as useRunSchedule, ZTe as useSaveFollowSchedule, $Y as useSaveSettings, tEe as useSaveThumbnailMode, EJ as useTable, GJ as useTablePreferences, gL as useViewGlide, tTe as victimBytes, Oge as vl, Lye as wantName, _Fe as watchNote, j3 as watchedShare, Ac as wireHorizontalScroller, pEe as withOrganizeJob, Vye as writeJavQuery, yge as z3 };-//# debugId=f801708c-39a2-426c-b8b8-125b72b1203f\ No newline at end of file+//# debugId=2e6b93a0-ea13-4213-bb53-e27291e2f849\ No newline at end of filediff --git a/web/dist/peach-pages.js b/web/dist/peach-pages.jsindex fbcc07dc6..47c27905e 100644--- a/web/dist/peach-pages.js+++ b/web/dist/peach-pages.js@@ -2,7 +2,7 @@(function() {try {var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "51613070-26e8-4783-9a83-ec3787385f9d", e._sentryDebugIdIdentifier = "sentry-dbid-51613070-26e8-4783-9a83-ec3787385f9d");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "565e5abd-bcf6-4552-9e8e-2e532129483f", e._sentryDebugIdIdentifier = "sentry-dbid-565e5abd-bcf6-4552-9e8e-2e532129483f");} catch {}})();var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, i, o, s) => {@@ -19772,7 +19772,10 @@ function ih({ done: e }) {summary: "运行信息",children: /* @__PURE__ */ (0, z.jsx)(qm, { children: e.facts.map((e) => /* @__PURE__ */ (0, z.jsxs)(Jm, {term: e.term,- children: [e.value, e.download_url ? /* @__PURE__ */ (0, z.jsx)(Km, {+ children: [e.value, e.install_tool ? /* @__PURE__ */ (0, z.jsx)("span", {+ className: "text-text-secondary",+ children: "可在配置页「应用与维护」里安装。"+ }) : e.download_url ? /* @__PURE__ */ (0, z.jsx)(Km, {href: e.download_url,children: e.download_label ?? e.download_url}) : null]@@ -22656,4 +22659,4 @@ E();var cv = document.getElementById("peach-page"), lv = cv ? sv[cv.dataset.page ?? ""] : void 0;cv && lv && (0, M.createRoot)(cv).render(/* @__PURE__ */ (0, z.jsx)(lv, { data: { ...cv.dataset } }));-//# debugId=51613070-26e8-4783-9a83-ec3787385f9d\ No newline at end of file+//# debugId=565e5abd-bcf6-4552-9e8e-2e532129483f\ No newline at end of file