Peach: Local-first video metadata scraper and media manager.
fix(integration): 接收已认可的 codex-configuration-failure-isolation 改动
longmeidaod81f9f9374cc
diff --git a/docs/CLOUDDRIVE_API.md b/docs/CLOUDDRIVE_API.mdindex a36435540..a58aed957 100644--- a/docs/CLOUDDRIVE_API.md+++ b/docs/CLOUDDRIVE_API.md@@ -12,6 +12,13 @@账号匹配复用推送发现的路径前缀及 CloudDrive 挂载点,只显示已添加媒体库对应的账号。`GetApiTokenInfo` 用于核对权限;凭据复用本机 CredentialStore。+CloudDrive2 地址填写服务入口,例如 `http://127.0.0.1:19798`;媒体目录和 API 令牌分别填写。+端口须为 1–65535 的整数,IPv6 使用方括号,例如 `http://[::1]:19798`。+留空时只探测本机的 19798、29798 端口;检查结果填回表单,由用户保存。+已保存地址无效时,下载分区保留原值及其他有效偏好,并显示检查提示,可直接修正保存。+配置读取中某个可选区域失败时,该区域显示「未取得」与「重新读取」,其他区域继续可用;+持续失败时导出诊断报告,报告中的配置区域名称和诊断编号用于定位异常。+代理读写通过进程内 gRPC 服务验证序列化、鉴权元数据、配置字段保留、密码不回显、修订冲突、账号归属和本机 HTTP 路由。生产写入由用户保存设置触发;测试不修改真实账号。原始协议有未使用的字段,生成的 protobuf 消息仍会保留未知字段,修改代理后整份回传。diff --git a/docs/REUSE.md b/docs/REUSE.mdindex 18023296a..3ddf7a68b 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -767,7 +767,11 @@ A 盘垃圾隔离使用短名称 `peach-purge-<32 位 UUID>.peach-quarantine`,| 本地 NFO 导入 | Kodi/Jellyfin NFO 协议(2026-09-06 核对 [Kodi](https://kodi.wiki/view/NFO_files/Movies)、[Jellyfin](https://jellyfin.org/docs/general/server/metadata/nfo/)),标准库 ElementTree,图片走项目固定版 Pillow;实现在 `library_nfo.py` | 只适配影片、单集与音乐视频(整剧、专辑、播放记录与远端图片引用不套用),拒绝 DTD、超大输入与越目录图片引用。同名边车优先,`movie.nfo` 与通用海报只用于单影片目录;正片和图片同属一组连号(`(1).mp4` 配 `(1).jpg`…)时同名图是图集的一张。已知内容词投影为中文标签,画质、促销、发行属性与演员编成丢弃,未收录的自定义标签保留;远端补厂牌、导演、发行商、时长与图片出处,人物主名精确一致时补 DMM id、假名、罗马字与首次头像,不替换演员真值。网络复用 R18 JSON 入口、SourceTransport、头像缓存与封面解析器。候选按资产 ID 与路径定位,批准时复核目标,时长证据不覆盖探测时长(ADR-0029) || JAV 高清封面 | Javinizer-Go `dd56998328d078c9baf68ff4fde2e6fcaa2a691a`(MIT)的 DMM modern `awsimgsrc.dmm.com/dig/...` 映射与尺寸门槛;Prestige 公开 API 的查询模型参考 MDCX `58e3f930f2e864fceb8a53ceef818716e2a6413d`(GPL-3.0,只作协议证据) | 候选、Range 量尺寸、面积最大者胜出与仅更大才原子升级见 `peach-jav-cover-workflow`。批量流程不请求社区来源,历史快照里的社区站只借厂牌;既有库采集在官方落空时经 `peach.community_catalog` 查 AVBase(取商品号认得出这个番号的店铺条目,名寄せ的标题可能来自合集)、JavBus 与 JavDB,两个图源先按 dHash 求一致,取景不同时用 OpenCV ORB(相似变换内点 ≥60 算同一张)。JavDB 只参与复核,不作为安装候选;其他单一图源留空 `verified_by`,遇验证页不绕过(ADR-0107)。MDC-NG 只证明 Amazon 日本渠道存在,只留 POC 候选。不写 ledger |-CloudDrive2 配置生成复用现有 TOML 模板、mDNS 公布地址和应用服务设置。HTTP 与 HTTPS 按各自默认端口生成 origin,非默认端口完整保留;配置读取、保存与更换密钥共用生成函数。该差异属于 Peach 部署配置,无需引入协议库或新增依赖;模板沿用现有 CloudDrive2 结构。回归用临时服务验证 HTTP 通知接收、密钥和来源校验,真实 ledger 与生产监听设置不参与验证。+CloudDrive2 配置生成复用现有 TOML 模板、mDNS 公布地址和应用服务设置,origin 由现有 `httpx.URL` 处理 IPv6 方括号及端口。HTTP 与 HTTPS 按各自默认端口生成 origin,非默认端口完整保留;配置读取、保存与更换密钥共用生成函数。该差异属于 Peach 部署配置,无需引入协议库或新增依赖;模板沿用现有 CloudDrive2 结构。回归用临时服务验证 HTTP 通知接收、密钥和来源校验,真实 ledger 与生产监听设置不参与验证。++云下载服务地址统一通过 `downloads.clean_address` 校验协议、主机、端口及凭据隔离;设置保存、gRPC 目标与本机自动发现共用该入口,解析失败转成 `DownloadError`。已保存的无效地址按原值呈现在配置表单,其余有效偏好保留,读取不写文件;修正保存后清除提示。渠道发现分别处理 CloudDrive2 与 PikPak 凭据错误,健康渠道继续提供。++配置读取复用 `_read_section` 隔离可选区域,以 `section_errors` 返回区域名称、操作提示和诊断编号;异常交给现有 `error_reporting.event` 留痕。页面复用 TanStack Query 重新读取和 BoardUI Note、Button,在对应分区提供重试;未知媒体来源或计数时隐藏依赖它们的媒体表单。鉴权、本机访问检查及核心设置校验仍由配置入口执行。无新增依赖、ledger 迁移或后台重试。依赖的第一个消费者及其隔离测试必须在同一改动落地,否则不引入依赖。表里没有单列的 Python 依赖及首个消费者:`numpy`(vision 组,`face_detect.decode` 直接 import)、`socksio`(PikPak 的 SOCKS 代理)、diff --git a/docs/ROUTES.md b/docs/ROUTES.mdindex cbda9efbe..33078c548 100644--- a/docs/ROUTES.md+++ b/docs/ROUTES.md@@ -34,6 +34,8 @@配置和首次设置的媒体行接受 `root_id`、`library_id`;新增媒体库使用独立 ID,同名不合并。既有根目录更改实际位置必须附 `change_mode: "relocate"`,保留 `root` 账本前缀;添加另一目录省略根目录身份。名称与图标在同一 `library_id` 的行间必须一致。非法路径、归属或身份通过原字段错误契约返回,不写配置。详见 [媒体库与存储根目录](OPERATIONS.md#媒体库与存储根目录)。+`GET /api/configuration` 的可选区域独立读取。区域失败时省略该字段,在 `section_errors[区域键]` 提供 `title`、`message`、`error_id`;其余成功字段继续返回。页面按分区显示提示并支持重新读取,依赖未取得媒体来源的配置表单暂停显示。`downloads.problems` 列出地址、凭据及渠道探测的问题,`downloads.config` 保留可修正的已保存地址及有效偏好;下载配置写入对地址严格校验,非法端口返回 400,并保留设置文件与凭据。+| 地址 | 用途 || --- | --- || `/` | 全部馆藏,含本地硬盘与已挂载网盘;新作行使用作品详情地址 |diff --git a/frontend/src/react/bundle.d.ts b/frontend/src/react/bundle.d.tsindex d79204e9e..c1302913e 100644--- a/frontend/src/react/bundle.d.ts+++ b/frontend/src/react/bundle.d.ts@@ -140,6 +140,7 @@ export type PikPakBrowserState = 'idle' | 'waiting' | 'done' | 'cancelled' | 'ti/** 设置页的云下载块。凭据只报存没存过,不回值。 */export interface DownloadSettingsState {+ problems?: string[];media_sources: string[];available: boolean;config: DownloadConfig;@@ -267,6 +268,7 @@ export interface ConfigurationFact {}export interface ConfigurationData {+ section_errors?: Record<string, { title: string; message: string; error_id: string }>;remote_reporting?: import('./settings/remote-reporting-settings').RemoteReportingState;library_sharing?: import('./settings/library-sharing-settings').LibrarySharingState;ledger_read_only?: boolean;@@ -321,6 +323,7 @@ export interface ConfigurationPanel {export interface ConfigurationGroupProps extends Pick<ConfigurationProps, 'receipt'> {data: ConfigurationData;panel?: ConfigurationPanel;+ issues?: import('react').ReactNode;}/** 高清版目标页仍由遗留层提供的能力。全是纯函数或导航,页面不持有它们的状态。 */diff --git a/frontend/src/react/settings/configuration-page.tsx b/frontend/src/react/settings/configuration-page.tsxindex 566003255..e782aabd6 100644--- a/frontend/src/react/settings/configuration-page.tsx+++ b/frontend/src/react/settings/configuration-page.tsx@@ -10,6 +10,7 @@ import { Fragment, useEffect, useLayoutEffect, useRef, useState, type KeyboardEvimport { peachHistory, shellNavigate, settingsPath } from '@peach/history';import { errorMessage } from '../../api';+import { Button } from '@/components/base/buttons/button';import type { ConfigurationData, ConfigurationPanel, ConfigurationProps } from '../bundle';import { Note } from '../components/note';import { PillTabList } from '../components/pill-tabs';@@ -25,6 +26,7 @@ import { SourceSettings } from './source-settings';import { groupRoot } from './configuration-panel';import { downloadsShape, maintenanceShape, networkShape } from './configuration-shape';import { rememberShape } from '../../configuration-skeleton';+import { busyProps } from './use-action';export function ConfigurationPage({ receipt, reopenTutorial, section = '', diagnostics }: ConfigurationProps & { diagnostics?: ReactElement }) {const config = useQuery({@@ -40,7 +42,18 @@ export function ConfigurationPage({ receipt, reopenTutorial, section = '', diagn</div>);}- return <ConfigurationGroups data={data} receipt={receipt} reopenTutorial={reopenTutorial} section={section} diagnostics={diagnostics} />;+ return <ConfigurationGroups data={data} receipt={receipt} reopenTutorial={reopenTutorial} section={section} diagnostics={diagnostics}+ refreshing={config.isFetching} reload={() => { void config.refetch({ cancelRefetch: false }); }} />;+}++function ConfigurationIssues({ data, sections, reload, refreshing }: {+ data: ConfigurationData; sections: string[]; reload(): void; refreshing: boolean;+}) {+ return <>{sections.map(key => {+ const issue = data.section_errors?.[key];+ return issue ? <Note key={key} tone="error" title={issue.title}+ action={<Button variant="secondary" size="small" onClick={reload} {...busyProps(refreshing)}>重新读取</Button>}>{issue.message}</Note> : null;+ })}</>;}interface Group { title: string; body(panel: ConfigurationPanel): ReactElement }@@ -51,7 +64,9 @@ let tabSequence = 0;/* 页签条是一个 tablist,方向键在整排里走、首尾相接,Home/End 到两头,挪到哪一格就选中哪一格、焦点跟过去。分区地址与选中项同步,表单保持挂载。 */function ConfigurationGroups(- { data, receipt, reopenTutorial, section, diagnostics }: Required<ConfigurationProps> & { data: ConfigurationData; diagnostics?: ReactElement },+ { data, receipt, reopenTutorial, section, diagnostics, reload, refreshing }: Required<ConfigurationProps> & {+ data: ConfigurationData; diagnostics?: ReactElement; reload(): void; refreshing: boolean;+ },) {const [prefix] = useState(() => `board-tabs-${++tabSequence}`);const [chosen, setChosen] = useState(section);@@ -89,22 +104,29 @@ function ConfigurationGroups(}, []);const buttons = useRef<(HTMLButtonElement | null)[]>([]);const group = { data, receipt };- const network = Boolean(data.peach_proxy || data.access || data.tunnel || (data.editable && data.port_editable !== false));+ const issues = (sections: string[]) => <ConfigurationIssues data={data} sections={sections} reload={reload} refreshing={refreshing} />;+ const networkKeys = ['peach_proxy', 'access', 'tunnel', 'push_discovery',+ ...(data.editable && data.port_editable !== false ? ['media_sources'] : [])];+ const network = Boolean(data.peach_proxy || data.access || data.tunnel || (data.editable && data.port_editable !== false)+ || networkKeys.some(key => data.section_errors?.[key]));const downloads = data.downloads;const groups: Group[] = [{ title: '媒体库与入库', body: (panel) => <div {...groupRoot(panel)}>- <MediaSettings {...group} /><CodePatternSettings receipt={receipt} />+ {issues(['media_sources', 'library_count', 'mount_dependencies'])}+ {!data.section_errors?.media_sources && !data.section_errors?.library_count ? <MediaSettings {...group} /> : null}+ <CodePatternSettings receipt={receipt} /><MediaProcessingSettings receipt={receipt} /></div> },- { title: '来源与订阅', body: (panel) => <SourceSettings {...group} panel={panel} /> },- ...(downloads ? [{+ { title: '来源与订阅', body: (panel) => <SourceSettings {...group} panel={panel} issues={issues(['entry_links'])} /> },+ ...(downloads || data.section_errors?.downloads ? [{title: '下载渠道',- body: (panel: ConfigurationPanel) => <DownloadGroup initial={downloads} receipt={receipt} panel={panel} />,+ body: (panel: ConfigurationPanel) => <DownloadGroup initial={downloads} receipt={receipt} panel={panel} issues={issues(['downloads'])} />,}] : []),- ...(network ? [{ title: '网络与访问', body: (panel: ConfigurationPanel) => <NetworkSettings {...group} panel={panel} /> }] : []),+ ...(network ? [{ title: '网络与访问', body: (panel: ConfigurationPanel) => <NetworkSettings {...group} panel={panel} issues={issues(networkKeys)} /> }] : []),{title: '应用与维护',body: (panel) => <div {...groupRoot(panel)}>+ {issues(['startup', 'uninstall', 'storage', 'remote_reporting', 'library_sharing', 'updates', 'update_job', 'automatic_updates', 'facts'])}<GeneralSettings {...group} /><PlaybackTranscodeSettings receipt={receipt} /><MaintenanceSettings {...group} reopenTutorial={reopenTutorial} />diff --git a/frontend/src/react/settings/download-settings.tsx b/frontend/src/react/settings/download-settings.tsxindex 27f6158aa..f8ef54a75 100644--- a/frontend/src/react/settings/download-settings.tsx+++ b/frontend/src/react/settings/download-settings.tsx@@ -11,7 +11,7 @@* 令牌与密码只往本机凭据文件写,读接口只回「存没存过」,所以令牌框保存后清空、提示改成* 「已保存,留空不改」。PikPak 要人机验证时服务端回一个验证页地址,这里给出链接让用户在浏览器* 里完成,Peach 不替他过验证。 */-import { useEffect, useState, type FormEvent } from 'react';+import { useEffect, useState, type FormEvent, type ReactNode } from 'react';import { Button } from '@/components/base/buttons/button';import { Chip } from '@/components/base/badges/chip';@@ -45,14 +45,16 @@ const POLL_MS = 2000;const PikPakIcon = providerIcon('pikpak');/** 「下载渠道」分组:CloudDrive2 与 PikPak 账号。 */-export function DownloadGroup({ initial, receipt, panel }: {- initial: DownloadSettingsState;+export function DownloadGroup({ initial, receipt, panel, issues }: {+ initial?: DownloadSettingsState;receipt(message: string): void;panel?: ConfigurationPanel;+ issues?: ReactNode;}) {return (<div {...groupRoot(panel)}>- <DownloadSettings initial={initial} receipt={receipt} />+ {issues}+ {initial ? <DownloadSettings initial={initial} receipt={receipt} /> : null}</div>);}@@ -191,6 +193,7 @@ function DownloadForm({ state, settle, receipt, pikpakAccount }: CardProps & { preturn (<Section title="云下载" onSubmit={submit}>+ {state.problems?.length ? <Stack><Note tone="error" title="云下载配置需要检查">{state.problems.join('\n')}</Note></Stack> : null}<Stack><Input label="CloudDrive2 地址" placeholder="留空自动查找" autoComplete="off" maxLength={200}value={config.clouddrive_address} isDisabled={!state.available}diff --git a/frontend/src/react/settings/network-settings.tsx b/frontend/src/react/settings/network-settings.tsxindex 4ddf021fb..9708205bf 100644--- a/frontend/src/react/settings/network-settings.tsx+++ b/frontend/src/react/settings/network-settings.tsx@@ -18,10 +18,11 @@ import { busyProps, useAction } from './use-action';const PROXY_MODES = [['environment', '系统代理'], ['direct', '直连'], ['proxy', '自定义']] as const;-export function NetworkSettings({ data, receipt, panel }: ConfigurationGroupProps) {+export function NetworkSettings({ data, receipt, panel, issues }: ConfigurationGroupProps) {return (<div {...groupRoot(panel)}>- {data.editable && data.port_editable !== false ? <PortSettings data={data} receipt={receipt} /> : null}+ {issues}+ {data.editable && data.port_editable !== false && !data.section_errors?.media_sources ? <PortSettings data={data} receipt={receipt} /> : null}{data.peach_proxy ? <PeachProxy initial={data.peach_proxy} receipt={receipt} /> : null}{data.access ? <AccessSettings initial={data.access} receipt={receipt} /> : null}{data.tunnel ? <TunnelSettings revision={data.revision} initial={data.tunnel} receipt={receipt} /> : null}diff --git a/frontend/src/react/settings/source-settings.tsx b/frontend/src/react/settings/source-settings.tsxindex 81505ea55..7fd8f6e46 100644--- a/frontend/src/react/settings/source-settings.tsx+++ b/frontend/src/react/settings/source-settings.tsx@@ -14,10 +14,11 @@ import { IndexerSettings } from './indexer-settings';import { SectionSkeleton } from './section';import { FollowPreferenceRows } from './service-preferences';-export function SourceSettings({ data, receipt, panel }: ConfigurationGroupProps) {+export function SourceSettings({ data, receipt, panel, issues }: ConfigurationGroupProps) {const credentials = useQuery({ queryKey: FOLLOW_CREDENTIALS_KEY,queryFn: ({ signal }) => fetchCredentials(signal), enabled: panel?.active !== false, refetchOnMount: 'always' });return <div {...groupRoot(panel)}>+ {issues}<div><ButtonLink href="/sources" variant="secondary">采集来源与登录状态</ButtonLink></div>{credentials.data? <Credentials data={credentials.data} readOnly={Boolean(data.ledger_read_only)} toast={receipt} embedded />diff --git a/frontend/test/react/configuration.test.tsx b/frontend/test/react/configuration.test.tsxindex 28d024381..421ae0123 100644--- a/frontend/test/react/configuration.test.tsx+++ b/frontend/test/react/configuration.test.tsx@@ -142,3 +142,49 @@ it('只读媒体配置可刷新挂载状态,更新共用配置快照', async (expect(section(host, '挂载状态')?.textContent).toContain('在线');expect(queryClient.getQueryData<ConfigurationData>(CONFIGURATION_KEY)?.revision).toBe('rev-2');});++it('下载设置未取得时保留分区与健康表单,并可重试恢复', async () => {+ const partial = full();+ delete partial.downloads;+ partial.section_errors = { downloads: { title: '下载设置未取得', message: '请重新读取。', error_id: 'test-error-id' } };+ const host = await open(partial, '下载渠道');+ expect(tabs(host).map(tab => tab.textContent)).toEqual(names);+ expect(chosen(host).textContent).toBe('下载渠道');+ expect(host.querySelector('.ui-board-group-active')?.textContent).toContain('下载设置未取得');+ expect(host.querySelector('[data-folder-row]')).not.toBeNull();+ serve(full());+ await click(buttonNamed('重新读取', host.querySelector('.ui-board-group-active')!));+ await settle();+ expect(host.textContent).not.toContain('下载设置未取得');+ expect(section(host, '云下载')).not.toBeNull();+});++it('局部配置错误出现在对应分区且不替换其他未保存输入', async () => {+ const host = await open(full());+ const input = host.querySelector<HTMLInputElement>('input[aria-label^="媒体目录 "]')!;+ await type(input, 'D:\\Edited');+ await act(async () => {+ queryClient.setQueryData(CONFIGURATION_KEY, { ...full(), section_errors: {+ storage: { title: '存储空间未取得', message: '请重新读取。', error_id: 'storage-error' },+ tunnel: { title: '公网入口未取得', message: '请重新读取。', error_id: 'tunnel-error' },+ } });+ });+ expect(input.value).toBe('D:\\Edited');+ expect(host.querySelector('.ui-board-group-active')?.textContent).not.toContain('存储空间未取得');+ await click(tabs(host).find(tab => tab.textContent === '应用与维护'));+ expect(host.querySelector('.ui-board-group-active')?.textContent).toContain('存储空间未取得');+ await click(tabs(host).find(tab => tab.textContent === '网络与访问'));+ expect(host.querySelector('.ui-board-group-active')?.textContent).toContain('公网入口未取得');+ expect(host.querySelector('#peachProxy')).not.toBeNull();+});++it('媒体来源未取得时隐藏会提交媒体配置的表单,其他设置仍可用', async () => {+ const partial = full();+ partial.section_errors = { media_sources: { title: '媒体目录未取得', message: '请重新读取。', error_id: 'media-error' } };+ const host = await open(partial);+ expect(host.querySelector('[data-folder-row]')).toBeNull();+ expect(host.querySelector('#configPort')).toBeNull();+ expect(host.querySelector('#peachProxy')).not.toBeNull();+ await click(tabs(host).find(tab => tab.textContent === '网络与访问'));+ expect(host.querySelector('.ui-board-group-active')?.textContent).toContain('媒体目录未取得');+});diff --git a/frontend/test/react/download-settings.test.tsx b/frontend/test/react/download-settings.test.tsxindex 273f1221c..b0fb98bd3 100644--- a/frontend/test/react/download-settings.test.tsx+++ b/frontend/test/react/download-settings.test.tsx@@ -26,6 +26,20 @@ const report = (patch: Partial<DownloadCheckReport> = {}): DownloadCheckReport =quota: null, suggested_target: null, suggested_pikpak_root: '', problems: [], ...patch,});+it('无效的已保存地址保留在表单中,修正保存后清除配置提示', async () => {+ vi.stubGlobal('fetch', fetchMock(200, state({ problems: [] })));+ const host = await mount(<DownloadSettings initial={state({+ config: { ...state().config, clouddrive_address: 'http://localhost:bad-port' },+ problems: ['CloudDrive2 地址的端口必须是整数'],+ })} receipt={vi.fn()} />);+ expect(field(host, 'CloudDrive2 地址')?.value).toBe('http://localhost:bad-port');+ expect(host.textContent).toContain('云下载配置需要检查');+ await type(field(host, 'CloudDrive2 地址'), 'http://127.0.0.1:19798');+ await submit(section(host, '云下载')!);+ await settle();+ expect(host.textContent).not.toContain('云下载配置需要检查');+});+const unfilled = () => state({config: { clouddrive_address: 'http://127.0.0.1:19798', targets: {}, pikpak_root: '', wait_hours: 168 },pikpak_roots: ['A:\\'],diff --git a/src/peach/downloads.py b/src/peach/downloads.pyindex 0816b46fa..4632a5dad 100644--- a/src/peach/downloads.py+++ b/src/peach/downloads.py@@ -530,6 +530,7 @@ class DownloadConfig:#: PikPak 根目录对应的数据库路径前缀;115 使用推送发现中配置的云端路径前缀。pikpak_root: str = ""wait_hours: int = DEFAULT_WAIT_HOURS+ problems: tuple[str, ...] = ()def payload(self) -> dict:return {"clouddrive_address": self.clouddrive_address, "targets": dict(self.targets),@@ -542,10 +543,19 @@ def clean_address(raw) -> str:return ""if "://" not in text:text = "http://" + text- parts = urlsplit(text)+ message = "CloudDrive2 地址只写协议、主机和端口,例如 http://127.0.0.1:19798"+ if len(text) > 2048 or "\\" in text or any(char.isspace() or ord(char) < 32 for char in text):+ raise ValueError(message)+ try:+ parts = urlsplit(text)+ port = parts.port+ except ValueError:+ raise ValueError("CloudDrive2 地址的端口必须是 1–65535 的整数,IPv6 地址须放在方括号内") from Noneif parts.scheme not in {"http", "https"} or not parts.hostname or parts.path not in {"", "/"} \- or parts.query or parts.username or parts.password:- raise ValueError("CloudDrive2 地址只写协议、主机和端口,例如 http://127.0.0.1:19798")+ or parts.query or parts.fragment or parts.username is not None or parts.password is not None:+ raise ValueError(message)+ if port == 0 or parts.netloc.endswith(":"):+ raise ValueError("CloudDrive2 地址的端口必须是 1–65535 的整数")return f"{parts.scheme}://{parts.netloc}"@@ -562,16 +572,16 @@ class DownloadSettings:return DownloadConfig()except (OSError, ValueError):LOGGER.warning("云下载设置读不出来,按默认值跑:%s", self.path)- return DownloadConfig()+ return DownloadConfig(problems=("云下载设置无法读取,请检查设置文件或重新填写。",))if not isinstance(payload, dict):- return DownloadConfig()+ return DownloadConfig(problems=("云下载设置格式不符,请检查设置文件或重新填写。",))try:- return self._parse(payload, declared_roots=None)+ return self._parse(payload, declared_roots=None, saved=True)except ValueError:LOGGER.warning("云下载设置有不合法的值,按默认值跑:%s", self.path)- return DownloadConfig()+ return DownloadConfig(problems=("云下载设置含有无效值,请检查目标目录和等待上限。",))- def _parse(self, body: dict, *, declared_roots) -> DownloadConfig:+ def _parse(self, body: dict, *, declared_roots, saved: bool = False) -> DownloadConfig:from .media_sources import SOURCE_REGISTRYtargets = {}raw_targets = body.get("targets") if isinstance(body.get("targets"), dict) else {}@@ -592,7 +602,15 @@ class DownloadSettings:raise ValueError("等待上限要写成小时数") from errorif not 1 <= hours <= MAX_WAIT_HOURS:raise ValueError(f"等待上限在 1 到 {MAX_WAIT_HOURS} 小时之间")- return DownloadConfig(clean_address(body.get("clouddrive_address")), targets, root, hours)+ problems = ()+ try:+ address = clean_address(body.get("clouddrive_address"))+ except ValueError as error:+ if not saved:+ raise+ address = str(body.get("clouddrive_address") or "").strip()+ problems = (str(error),)+ return DownloadConfig(address, targets, root, hours, problems)def save(self, body: dict, declared_roots) -> DownloadConfig:if not isinstance(body, dict):diff --git a/src/peach/downloads_channels.py b/src/peach/downloads_channels.pyindex 8e85fc4eb..caa20f937 100644--- a/src/peach/downloads_channels.py+++ b/src/peach/downloads_channels.py@@ -13,6 +13,7 @@ from .downloads_clouddrive import CloudDriveClient, PROBE_TIMEOUTfrom .media_sources import SOURCESfrom .clouddrive_proxy import media_remote_pathfrom .push_discovery import normalise_prefix+from .follow_secrets import CredentialErrordef root_key(value):@@ -35,18 +36,28 @@ class LibraryChannels:if location in SOURCES and SOURCES[location].cloud}prefixes = tuple(getattr(getattr(service.landing.push_discovery, "config", None), "prefixes", ()))names = {root_key(root): name for root, name in self.names().items()}- cloud = service.credentials.load(CLOUDDRIVE_CREDENTIAL)+ problems = []+ try:+ cloud = service.credentials.load(CLOUDDRIVE_CREDENTIAL)+ except CredentialError:+ cloud = None+ problems.append("CloudDrive2 令牌无法读取,请重新填写。")token = str(cloud.values.get("token", "")) if cloud else ""- pikpak = service.credentials.describe(PIKPAK_CREDENTIAL)+ try:+ pikpak = service.credentials.describe(PIKPAK_CREDENTIAL)+ except CredentialError:+ pikpak = {"fields": []}+ problems.append("PikPak 登录信息无法读取,请重新登录。")logged_in = "refresh_token" in pikpak["fields"]fingerprint = (repr(config.payload()), repr(roots), repr(prefixes), repr(names),repr(getattr(service.landing, "mounts", {})), logged_in,- hashlib.sha256(token.encode()).digest())+ hashlib.sha256(token.encode()).digest(), tuple(problems))with self._lock:now = self.clock()if self._cached and self._cached[0] == fingerprint and now - self._cached[1] < 30:return self._cached[2]result = self._discover(roots, prefixes, names, token, logged_in)+ result["problems"] = list(dict.fromkeys((*problems, *result["problems"])))self._cached = fingerprint, now, resultreturn resultdiff --git a/src/peach/downloads_clouddrive.py b/src/peach/downloads_clouddrive.pyindex cffd5420f..c305c7673 100644--- a/src/peach/downloads_clouddrive.py+++ b/src/peach/downloads_clouddrive.py@@ -30,7 +30,7 @@ from google.protobuf import empty_pb2from . import downloads_clouddrive_pb2 as pbfrom .downloads import (DONE, ERROR, MISSING, RUNNING, DownloadError, DownloadTask, Magnet, RemoteStatus,- classify_remote_message, magnet_info_hash,+ classify_remote_message, clean_address, magnet_info_hash,)from .push_discovery import CloudPrefix, normalise_prefix@@ -80,8 +80,12 @@ _AUTH_CODES = {grpc.StatusCode.UNAUTHENTICATED, grpc.StatusCode.PERMISSION_DENIEdef channel_target(address: str) -> tuple[str, bool]:- """`http://host:port` → (`host:port`, 不加密)。设置层已经校验过形态。"""- parts = urlsplit(address if "://" in address else "http://" + address)+ """校验服务地址并生成 gRPC 目标;非法地址使用下载领域错误。"""+ try:+ address = clean_address(address)+ except ValueError as error:+ raise DownloadError("config", str(error)) from error+ parts = urlsplit(address)if not parts.hostname:raise DownloadError("config", "CloudDrive2 地址没填")port = parts.port or (443 if parts.scheme == "https" else 19798)@@ -112,8 +116,12 @@ def answers(address: str, *, timeout: float = PROBE_TIMEOUT) -> bool:def discover(addresses: tuple[str, ...] = LOCAL_ADDRESSES) -> str:"""按顺序试,返回第一个应答的地址;都不应答时报错并原样列出试过的地址。"""for address in addresses:- if answers(address):- return address+ try:+ normalized = clean_address(address)+ except ValueError:+ continue+ if normalized and answers(normalized):+ return normalizedtried = "、".join(addresses)raise DownloadError("network", f"没有填 CloudDrive2 地址,本机 {tried} 都没有应答。""确认 CloudDrive2 已启动,或在地址栏填上它的实际地址")diff --git a/src/peach/routes_configuration.py b/src/peach/routes_configuration.pyindex aecd34003..39b9ee582 100644--- a/src/peach/routes_configuration.py+++ b/src/peach/routes_configuration.py@@ -16,13 +16,15 @@ import shutilimport threadingimport jsonimport time+import uuidfrom typing import Any+import httpxfrom fastapi import APIRouter, Body, Depends, HTTPException, Requestfrom fastapi.responses import JSONResponse, Responsefrom filelock import FileLock, Timeout-from . import (access, data_storage, distribution, entry_links, folder_picker, media_libraries, onboarding,+from . import (access, data_storage, distribution, entry_links, error_reporting, folder_picker, media_libraries, onboarding,push_discovery, settings_file, media_configuration, tunnel, web_downloads)from .routes_auth import require_auth, require_authenticated_client, same_originfrom .web_entry import runtime_fact_entries@@ -180,35 +182,56 @@ def configurable(request: Request) -> bool:and local_client(request))+def _read_section(result: dict, key: str, title: str, reader) -> None:+ """各配置区域独立读取;故障留痕并提供重试信息。"""+ try:+ result[key] = reader()+ except Exception as error:+ error_id = uuid.uuid4().hex+ result.setdefault("section_errors", {})[key] = {+ "title": f"{title}未取得", "message": "请重新读取;持续失败时导出诊断报告。",+ "error_id": error_id,+ }+ error_reporting.event("logging", error, logger=__name__, level="ERROR",+ message=f"配置区域 {key} 读取失败", section=key, error_id=error_id)++def snapshot(config) -> dict[str, Any]:"""配置页首屏要的一切:当前值、修订号、可写与否,以及这台机器的运行信息。"""editable = managed_configuration()from . import remote_reporting, library_sharingmedia = config.mounts.get("local") or config.locations.get("local", ())- return {- "remote_reporting": remote_reporting.snapshot(config),- "library_sharing": library_sharing.snapshot(config),- "startup": desktop_startup.snapshot(config),- "uninstall": desktop_uninstall.snapshot(config),- "storage": data_storage.snapshot(config),- "peach_proxy": peach_proxy.describe(config.directory("secrets")),- "entry_links": entry_links.snapshot(config.directory("state")),- "updates": release_updates.snapshot(),- "update_job": standalone_update.public(),- "access": access.public(access.load(config.directory("secrets") / "access.json")),+ result = {"editable": editable,"notice": "" if editable else FILE_MANAGED_NOTICE,"revision": revision(config),"media_dirs": list(media),- "media_sources": media_configuration.rows(config, windows=os.name == "nt", probe=True),# 媒体库按持久身份计数,与侧栏切换器和 `/api/libraries` 共用分组。- "library_count": len(media_libraries.libraries(config)),- "mount_dependencies": media_configuration.mount_dependencies(),+ "library_count": 0,"windows": os.name == "nt","port": config.server.port,"port_editable": distribution.standalone(),- "facts": runtime_fact_entries(config),+ "facts": [],}+ readers = (+ ("remote_reporting", "错误诊断设置", lambda: remote_reporting.snapshot(config)),+ ("library_sharing", "馆藏上传设置", lambda: library_sharing.snapshot(config)),+ ("startup", "开机启动设置", lambda: desktop_startup.snapshot(config)),+ ("uninstall", "卸载信息", lambda: desktop_uninstall.snapshot(config)),+ ("storage", "存储空间", lambda: data_storage.snapshot(config)),+ ("peach_proxy", "Peach 代理", lambda: peach_proxy.describe(config.directory("secrets"))),+ ("entry_links", "外部入口", lambda: entry_links.snapshot(config.directory("state"))),+ ("updates", "版本更新", release_updates.snapshot),+ ("update_job", "更新任务", standalone_update.public),+ ("access", "访问设置", lambda: access.public(access.load(config.directory("secrets") / "access.json"))),+ ("media_sources", "媒体目录", lambda: media_configuration.rows(config, windows=os.name == "nt", probe=True)),+ ("library_count", "媒体库状态", lambda: len(media_libraries.libraries(config))),+ ("mount_dependencies", "挂载依赖", media_configuration.mount_dependencies),+ ("facts", "运行信息", lambda: runtime_fact_entries(config)),+ )+ for key, title, reader in readers:+ _read_section(result, key, title, reader)+ return resultdef tunnel_payload(config, state: tunnel.TunnelSnapshot, enabled: bool) -> dict[str, Any]:@@ -252,7 +275,7 @@ def push_discovery_payload(request: Request, payload: dict[str, Any] | None = Noorigin = ""if address:scheme, default_port = ("https", 443) if settings.tls_enabled else ("http", 80)- origin = f"{scheme}://{address}" if port in (0, default_port) else f"{scheme}://{address}:{port}"+ origin = str(httpx.URL(scheme=scheme, host=address, port=port or default_port))payload["origin"] = originpayload["config_toml"] = push_discovery.clouddrive_config(origin, payload.get("secret", ""))return payload@@ -267,13 +290,13 @@ def read_configuration(request: Request, _args=Depends(require_auth)):result = snapshot(config)sync = getattr(request.app.state, "sync", None)result["ledger_read_only"] = bool(sync is not None and sync.read_only)- state = request.app.state.tunnel.snapshot()- result["tunnel"] = tunnel_payload(config, state, config.tunnel.enabled)- result["automatic_updates"] = request.app.state.automatic_updates.snapshot()+ _read_section(result, "tunnel", "公网入口", lambda: tunnel_payload(+ config, request.app.state.tunnel.snapshot(), config.tunnel.enabled))+ _read_section(result, "automatic_updates", "自动更新", lambda: request.app.state.automatic_updates.snapshot())# 这一路已经过了 `local_only`,密钥可以给出来:用户要把它抄进 CloudDrive2。- result["push_discovery"] = push_discovery_payload(request)- result["downloads"] = web_downloads.settings_payload(*_downloads(request))- if result["automatic_updates"].get("result"):+ _read_section(result, "push_discovery", "推送发现", lambda: push_discovery_payload(request))+ _read_section(result, "downloads", "下载设置", lambda: web_downloads.settings_payload(*_downloads(request)))+ if result.get("automatic_updates", {}).get("result"):result["updates"] = result["automatic_updates"]["result"]return resultdiff --git a/src/peach/web_downloads.py b/src/peach/web_downloads.pyindex 8c02e30c2..512726ce8 100644--- a/src/peach/web_downloads.py+++ b/src/peach/web_downloads.py@@ -140,21 +140,30 @@ def settings_payload(service: DownloadService, declared_roots) -> dict:"""设置页那一块的形状。读接口和每条写接口都回这一份,页面整块替换本地状态。"""from .downloads_pikpak import accountcredentials = service.credentials+ problems = list(getattr(service.config, "problems", ()))try:pikpak = account(_values(credentials, PIKPAK_CREDENTIAL))except DownloadError:pikpak = account(None)+ problems.append("PikPak 登录信息无法读取,请重新登录。")+ try:+ token_set = "token" in credentials.describe(CLOUDDRIVE_CREDENTIAL)["fields"]+ except CredentialError:+ token_set = False+ problems.append("CloudDrive2 令牌无法读取,请重新填写。")login = _browser_login(service)+ channels = service.channel_snapshot()return {"available": service.available,"media_sources": [key for key, roots in declared_roots.items() if roots],"config": service.config.payload(),- "token_set": "token" in credentials.describe(CLOUDDRIVE_CREDENTIAL)["fields"],+ "token_set": token_set,"pikpak": pikpak,"pikpak_browser": {"available": login is not None and login.available(),**(login.status() if login is not None else {"state": "idle", "message": ""})},"pikpak_roots": list(declared_roots.get("pikpak", ())),- "providers": service.channel_snapshot()["providers"],+ "providers": channels["providers"],+ "problems": list(dict.fromkeys((*problems, *channels.get("problems", ())))),"max_wait_hours": MAX_WAIT_HOURS,}diff --git a/tests/test_configuration_sources.py b/tests/test_configuration_sources.pyindex e0eb4f712..0068856fc 100644--- a/tests/test_configuration_sources.py+++ b/tests/test_configuration_sources.py@@ -1,5 +1,6 @@"""CloudDrive 表单、来源映射与离线状态的隔离回归。"""from dataclasses import replace+from contextlib import ExitStackimport ntpathimport osfrom pathlib import Path, PurePosixPath, PureWindowsPath@@ -11,6 +12,89 @@ from unittest.mock import patchfrom peach import media_configuration as media_config, onboarding, settings_file+class ConfigurationIsolationTests(unittest.TestCase):+ def setUp(self):+ temporary = tempfile.TemporaryDirectory()+ self.addCleanup(temporary.cleanup)+ self.root = Path(temporary.name).resolve()+ self.config = settings_file.PeachConfig(self.root, self.root / "config.toml", present=True)+ self.config.path.write_text("[server]\nport = 8900\n", encoding="utf-8")++ def test_optional_configuration_readers_fail_independently_with_diagnostic_ids(self):+ from peach import routes_configuration as routes, remote_reporting, library_sharing++ readers = (+ ("remote_reporting", remote_reporting, "snapshot", {}),+ ("library_sharing", library_sharing, "snapshot", {}),+ ("startup", routes.desktop_startup, "snapshot", {}),+ ("uninstall", routes.desktop_uninstall, "snapshot", {}),+ ("storage", routes.data_storage, "snapshot", {}),+ ("peach_proxy", routes.peach_proxy, "describe", {}),+ ("entry_links", routes.entry_links, "snapshot", {}),+ ("updates", routes.release_updates, "snapshot", {}),+ ("update_job", routes.standalone_update, "public", {}),+ ("access", routes.access, "load", {}),+ ("media_sources", routes.media_configuration, "rows", []),+ ("library_count", routes.media_libraries, "libraries", []),+ ("mount_dependencies", routes.media_configuration, "mount_dependencies", []),+ ("facts", routes, "runtime_fact_entries", []),+ )+ for failed, *_ in readers:+ with self.subTest(failed=failed), ExitStack() as stack:+ for key, module, name, value in readers:+ stack.enter_context(patch.object(module, name, side_effect=RuntimeError("private-detail"))+ if key == failed else patch.object(module, name, return_value=value))+ stack.enter_context(patch.object(routes.access, "public", return_value={}))+ emit = stack.enter_context(patch.object(routes.error_reporting, "event"))+ result = routes.snapshot(self.config)+ self.assertEqual(list(result["section_errors"]), [failed])+ self.assertEqual(len(result["section_errors"][failed]["error_id"]), 32)+ self.assertNotIn("private-detail", str(result))+ self.assertEqual(result["media_dirs"], [])+ self.assertEqual(result["port"], 8900)+ self.assertEqual(emit.call_args.kwargs["section"], failed)++ def test_runtime_configuration_sections_do_not_hide_the_healthy_sections(self):+ from unittest.mock import Mock+ from peach import routes_configuration as routes++ for failed in ("tunnel", "automatic_updates", "push_discovery", "downloads"):+ with self.subTest(failed=failed), ExitStack() as stack:+ state = SimpleNamespace(sync=None, tunnel=Mock(), automatic_updates=Mock(),+ downloads=object(), push_discovery=SimpleNamespace(declared_roots={}))+ state.tunnel.snapshot.return_value = object()+ state.automatic_updates.snapshot.return_value = {"state": "idle"}+ if failed in ("tunnel", "automatic_updates"):+ getattr(state, failed).snapshot.side_effect = OSError("private-detail")+ request = SimpleNamespace(app=SimpleNamespace(state=state))+ stack.enter_context(patch.object(routes, "local_only"))+ stack.enter_context(patch.object(routes.settings_file, "load_config", return_value=self.config))+ stack.enter_context(patch.object(routes, "snapshot", return_value={"media_dirs": [], "port": 8900}))+ stack.enter_context(patch.object(routes, "tunnel_payload", return_value={"state": "idle"}))+ for key, module, name in (("push_discovery", routes, "push_discovery_payload"),+ ("downloads", routes.web_downloads, "settings_payload")):+ stack.enter_context(patch.object(module, name, side_effect=OSError("private-detail"))+ if key == failed else patch.object(module, name, return_value={"ok": True}))+ stack.enter_context(patch.object(routes.error_reporting, "event"))+ result = routes.read_configuration(request)+ self.assertEqual(list(result["section_errors"]), [failed])+ self.assertEqual(result["port"], 8900)+ for key in {"tunnel", "automatic_updates", "push_discovery", "downloads"} - {failed}:+ self.assertIn(key, result)++ def test_generated_push_discovery_origins_support_ipv6_and_actual_ports(self):+ from peach import routes_configuration as routes++ for address, port, tls, expected in (("::1", 443, True, "https://[::1]"),+ ("::1", 8443, True, "https://[::1]:8443"),+ ("192.0.2.1", 8900, False, "http://192.0.2.1:8900")):+ with self.subTest(address=address, port=port):+ state = SimpleNamespace(mdns=SimpleNamespace(address=address), settings=SimpleNamespace(+ mdns_address=None, mdns_port=port, tls_enabled=tls))+ result = routes.push_discovery_payload(SimpleNamespace(app=SimpleNamespace(state=state)), {})+ self.assertEqual(result["origin"], expected)++class MediaConfigurationTests(unittest.TestCase):def test_posix_paths_without_internal_prefixes_can_be_saved(self):sources = [{"location": "local", "path": "/media/local"},diff --git a/tests/test_downloads.py b/tests/test_downloads.pyindex 818cc9b7a..dc0955eaa 100644--- a/tests/test_downloads.py+++ b/tests/test_downloads.py@@ -400,6 +400,34 @@ class LandingTests(_Deployment):class SettingsTests(_Deployment):+ def test_service_addresses_validate_ports_and_preserve_supported_hosts(self):+ for address in ("http://127.0.0.1:abc", "http://localhost:0", "http://localhost:65536",+ "http://localhost:", "http://localhost:19798#fragment", "http://[::1",+ "http://127.0.0.1:19 798", "http://@localhost:19798", "http://localhost\x00:19798",+ "C:\\CloudDrive2\\CloudDrive2.exe"):+ with self.subTest(address=address), self.assertRaises(ValueError):+ dl.clean_address(address)+ for source, expected in (("localhost:19798", "http://localhost:19798"),+ ("http://[::1]:19798", "http://[::1]:19798"),+ ("https://example.test", "https://example.test")):+ with self.subTest(source=source):+ self.assertEqual(dl.clean_address(source), expected)++ def test_invalid_saved_address_is_editable_and_preserves_other_preferences(self):+ path = self.service.settings.path+ path.parent.mkdir(parents=True, exist_ok=True)+ stored = {"clouddrive_address": "http://localhost:bad-port", "targets": {"115": "/115/Movies"},+ "pikpak_root": "P:\\", "wait_hours": 48}+ payload = json.dumps(stored).encode()+ path.write_bytes(payload)+ loaded = self.service.settings.load()+ self.assertEqual(loaded.payload(), stored)+ self.assertIn("端口", loaded.problems[0])+ self.assertEqual(path.read_bytes(), payload)+ corrected = self.service.settings.save({**stored, "clouddrive_address": "localhost:19798"}, None)+ self.assertEqual(corrected.problems, ())+ self.assertEqual(corrected.targets, stored["targets"])+def test_snapshot_hides_remote_cancel_when_the_channel_cannot_cancel(self):task_id = self.submit()["task"]["id"]self.service.channel_catalog = lambda: {"providers": [{diff --git a/tests/test_downloads_channels.py b/tests/test_downloads_channels.pyindex c0c3107f3..3627ae623 100644--- a/tests/test_downloads_channels.py+++ b/tests/test_downloads_channels.py@@ -7,9 +7,22 @@ from peach.downloads import DownloadConfig, DownloadError, DownloadTask, Landingfrom peach.downloads_channels import LibraryChannelsfrom peach.downloads_clouddrive import Folderfrom peach.push_discovery import CloudPrefix+from peach.follow_secrets import CredentialErrorclass LibraryChannelTests(unittest.TestCase):+ def test_a_broken_clouddrive_credential_keeps_a_healthy_pikpak_channel(self):+ self.credentials.load.side_effect = CredentialError("test-only-secret-detail")+ self.credentials.describe.return_value = {"fields": ["refresh_token"]}+ self.service.config = DownloadConfig("http://localhost:bad-port", targets={"pikpak": "/Movies"},+ pikpak_root="P:\\")+ self.service.landing.declared_roots["pikpak"] = ("P:\\",)+ result = self.catalog()+ self.assertEqual([row["key"] for row in result["providers"]], ["pikpak"])+ self.assertIn("CloudDrive2 令牌无法读取", result["problems"][0])+ self.assertNotIn("test-only-secret-detail", str(result))+ self.factory.assert_not_called()+def setUp(self):self.credentials = Mock()self.credentials.load.return_value = SimpleNamespace(values={"token": "test-only-token"})diff --git a/tests/test_downloads_clouddrive.py b/tests/test_downloads_clouddrive.pyindex 64f7139d5..9c6297662 100644--- a/tests/test_downloads_clouddrive.py+++ b/tests/test_downloads_clouddrive.py@@ -297,6 +297,19 @@ class CheckTests(_Server):def test_addresses_turn_into_grpc_targets(self):self.assertEqual(cd.channel_target("http://127.0.0.1"), ("127.0.0.1:19798", False))self.assertEqual(cd.channel_target("https://192.0.2.10:8443"), ("192.0.2.10:8443", True))+ self.assertEqual(cd.channel_target("http://[::1]:19798"), ("[::1]:19798", False))+ for address in ("http://localhost:bad-port", "http://localhost:0", "http://localhost:65536"):+ with self.subTest(address=address), self.assertRaises(dl.DownloadError) as raised:+ cd.channel_target(address)+ self.assertEqual(raised.exception.failure, "config")++ def test_discovery_returns_only_validated_service_addresses(self):+ from unittest.mock import patch+ with patch.object(cd, "answers", return_value=True) as answers:+ address = cd.discover(("http://localhost:bad-port", "127.0.0.1:19798"))+ self.assertEqual(address, "http://127.0.0.1:19798")+ answers.assert_called_once_with(address)+ self.assertTrue(all(dl.clean_address(address) == address for address in cd.LOCAL_ADDRESSES))self.assertEqual(cd.split_remote("/115/云下载/"), ("/115", "云下载"))diff --git a/tests/test_web_downloads.py b/tests/test_web_downloads.pyindex 74177eef0..9f79157dd 100644--- a/tests/test_web_downloads.py+++ b/tests/test_web_downloads.py@@ -234,6 +234,45 @@ class RouteTests(_App):class SettingsBlockTests(_App):"""CloudDrive2 那一侧换成 `self.answer`;没有令牌时走真的 `check`,它在连网之前就停。"""+ def test_invalid_service_address_is_refused_before_settings_or_token_are_saved(self):+ self.service.save_settings({"clouddrive_address": "localhost:19798", "wait_hours": 48}, self.roots())+ before = self.service.settings.path.read_bytes()+ stored_secrets = self.secrets()+ client = TestClient(self.app, client=("127.0.0.1", 50000), base_url="http://127.0.0.1")+ response = client.post("/api/configuration/downloads", json={+ "clouddrive_address": "http://localhost:bad-port", "token": "test-only-new-token"})+ self.assertEqual(response.status_code, 400, response.text)+ self.assertIn("端口", response.text)+ self.assertEqual(self.service.settings.path.read_bytes(), before)+ self.assertEqual(self.secrets(), stored_secrets)++ def test_saved_invalid_address_and_token_keep_configuration_readable_and_repairable(self):+ from peach import routes_configuration, settings_file+ from peach.downloads_channels import LibraryChannels++ self.service.settings.path.parent.mkdir(parents=True, exist_ok=True)+ raw = {"clouddrive_address": "http://localhost:bad-port", "targets": {"115": "/115/Movies"},+ "pikpak_root": "", "wait_hours": 48}+ self.service.settings.path.write_text(json.dumps(raw), encoding="utf-8")+ before = self.service.settings.path.read_bytes()+ self.service.config = self.service.settings.load()+ self.service.credentials.save(dl.CLOUDDRIVE_CREDENTIAL, {"token": "test-only-token"})+ self.service.landing.declared_roots = {"115": ("R:\\Media",)}+ self.service.channel_catalog = LibraryChannels(self.service, lambda: {})+ config = settings_file.PeachConfig(self.root, self.root / "config.toml", present=True)+ client = TestClient(self.app, client=("127.0.0.1", 50000), base_url="http://127.0.0.1")+ with mock.patch.object(settings_file, "load_config", return_value=config), \+ mock.patch.object(routes_configuration, "snapshot", return_value={"port": 8900, "media_dirs": []}):+ response = client.get("/api/configuration")+ self.assertEqual(response.status_code, 200, response.text)+ state = response.json()["downloads"]+ self.assertEqual(state["config"], raw)+ self.assertTrue(state["token_set"])+ self.assertTrue(any("端口" in problem for problem in state["problems"]))+ self.assertEqual(state["providers"], [])+ self.assertNotIn("test-only-token", response.text)+ self.assertEqual(self.service.settings.path.read_bytes(), before)+def setUp(self):super().setUp()real = downloads_clouddrive.checkdiff --git a/web/dist/peach-app.configuration-page-Bxq5ZZc_.js b/web/dist/peach-app.configuration-page-CZadQb1A.jssimilarity index 97%rename from web/dist/peach-app.configuration-page-Bxq5ZZc_.jsrename to web/dist/peach-app.configuration-page-CZadQb1A.jsindex 40de2e171..0ea9fcb53 100644--- a/web/dist/peach-app.configuration-page-Bxq5ZZc_.js+++ b/web/dist/peach-app.configuration-page-CZadQb1A.js@@ -1,7 +1,7 @@(function() {try {var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "78aa664a-ede9-4231-94fa-85a243e03341", e._sentryDebugIdIdentifier = "sentry-dbid-78aa664a-ede9-4231-94fa-85a243e03341");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "de944ccb-4459-4af8-9b8c-e6c4d4ff544a", e._sentryDebugIdIdentifier = "sentry-dbid-de944ccb-4459-4af8-9b8c-e6c4d4ff544a");} catch {}})();import { $2ec61d1d4f780267$export$a8a3e93435678ff9 as e, $3a442827418ebe87$export$eb2fcfdbd7ba97d4 as t, $542a13ca2fa5b484$export$5b6b19405a83ff9d as n, $72abaeab4d80592f$export$78efe591171d7d45 as r, $bd263d78e9bf3c56$export$f5c9f3c2c4054eec as i, $ea3928288112382f$export$439d29a4e110a164 as a, $f2ff30fde7b014be$export$3ddf2d174ce01153 as o, $fe21c36db05242bb$export$a98f0dcb43a68a25 as s, $fe21c36db05242bb$export$d7b12c4107be0d61 as c, ACCENT_CHOICES as l, ApiError as u, Button as d, ButtonLink as f, CLOUD_LOCATIONS as p, CLOUD_PROXY_HELP as m, CONFIGURATION_KEY as h, CONFIGURATION_URL as g, CREDENTIAL_STATE as _, Checkbox as v, Chip as y, Disclosure as b, ENTRY_LINKS_HELP as x, ENTRY_LINKS_HINT as S, EmptyState as ee, ErrorText as C, ExternalLink as w, FEED_SCHEDULE_KEY as T, FOLLOW_CREDENTIALS_KEY as E, FOLLOW_INITIAL_RANGE_OPTIONS as te, FOLLOW_SCHEDULE_KEY as ne, Fact as D, FactList as O, FieldLabel as k, Footer as A, Help as j, HintText as re, Input as M, LIBRARY_FOLDER_HELP as ie, LIBRARY_PROCESSING_KEY as ae, Label as oe, LinkButton as se, LoadingDots as ce, M6 as le, MEDIA_PROCESSING_KEY as ue, MEDIA_PROCESSING_URL as de, MEDIA_SOURCE_ICONS as fe, MENU_POPOVER_SURFACE as pe, Note as N, PICK_FOLDER_URL as me, POLICY_COLUMNS as he, POLICY_COVER_NOTE as ge, POLICY_MATRIX as _e, POLICY_SUMMARY as ve, PathLine as ye, PillTabList as be, Progress as xe, Rows as P, SEGMENT as Se, SEGMENTED_TRACK as Ce, SETTINGS_KEY as we, SETTINGS_URL as Te, Section as F, SectionSkeleton as Ee, SegmentedRadioGroup as De, Select as Oe, Select$1 as I, SelectItem as L, SettingsCard as ke, SettingsRow as R, SiteLabel as Ae, SourceLabel as z, SourceMark as je, Stack as B, StatusLabel as V, Switch as H, THUMBNAIL_JOBS_KEY as Me, TextField as Ne, TextFieldContext as Pe, __toESM as Fe, apiGet as U, apiSend as W, appSettingsStore as Ie, boundedPreference as Le, busyProps as G, cardClass as Re, cloudProxySkeleton as ze, cn as Be, confirmModal as Ve, credentialDone as He, credentialsSkeleton as Ue, cx as We, errorMessage as K, fetchConfiguration as Ge, fetchCredentials as Ke, fetchFeedSchedule as qe, fetchFollowSchedule as Je, fetchMediaProcessing as Ye, fetchSettings as Xe, fetchThumbnailJobs as Ze, fmtSize as Qe, indexersSkeleton as $e, javBrowserSkeleton as et, momentText as tt, overlayHost as nt, peachHistory$1 as rt, previewLibraryColor as it, providerIcon as at, queryClient as q, randomId as ot, rememberShape as J, require_jsx_runtime as st, require_react as ct, saveCredential as lt, schedulePollInterval as ut, settingsPath as dt, shellNavigate as ft, sortCx as pt, sourceDefaultCost as mt, useAction as Y, useLibraryTints as ht, useMutation as gt, useQuery as X, useRunSchedule as _t, useSaveFollowSchedule as vt, useSaveSettings as yt, useSaveThumbnailMode as bt } from "./peach-app.js";@@ -233,13 +233,13 @@ function Bt({ initial: e, receipt: t }) {//#endregion//#region src/react/settings/download-settings.tsxvar Vt = "/api/configuration/downloads", Ht = "/api/configuration/downloads/check", Ut = "/api/configuration/downloads/folder", Wt = "/api/configuration/downloads/pikpak/login", Gt = "/api/configuration/downloads/pikpak/logout", Kt = "/api/configuration/downloads/pikpak/browser-login", qt = 2e3, Jt = at("pikpak");-function Yt({ initial: e, receipt: t, panel: n }) {- return /* @__PURE__ */ (0, $.jsx)("div", {+function Yt({ initial: e, receipt: t, panel: n, issues: r }) {+ return /* @__PURE__ */ (0, $.jsxs)("div", {...Q(n),- children: /* @__PURE__ */ (0, $.jsx)(Xt, {+ children: [r, e ? /* @__PURE__ */ (0, $.jsx)(Xt, {initial: e,receipt: t- })+ }) : null]});}function Xt({ initial: e, receipt: t }) {@@ -331,6 +331,11 @@ function Zt({ state: e, settle: t, receipt: n, pikpakAccount: r }) {}, (e) => v(K(e)));},children: [+ e.problems?.length ? /* @__PURE__ */ (0, $.jsx)(B, { children: /* @__PURE__ */ (0, $.jsx)(N, {+ tone: "error",+ title: "云下载配置需要检查",+ children: e.problems.join("\n")+ }) }) : null,/* @__PURE__ */ (0, $.jsxs)(B, { children: [/* @__PURE__ */ (0, $.jsx)(M, {label: "CloudDrive2 地址",@@ -3313,11 +3318,12 @@ var Er = [["direct", "直连"],["proxy", "自定义"]];-function Dr({ data: e, receipt: t, panel: n }) {+function Dr({ data: e, receipt: t, panel: n, issues: r }) {return /* @__PURE__ */ (0, $.jsxs)("div", {...Q(n),children: [- e.editable && e.port_editable !== !1 ? /* @__PURE__ */ (0, $.jsx)(xr, {+ r,+ e.editable && e.port_editable !== !1 && !e.section_errors?.media_sources ? /* @__PURE__ */ (0, $.jsx)(xr, {data: e,receipt: t}) : null,@@ -3795,8 +3801,8 @@ function Vr({ initial: e, receipt: t }) {}//#endregion//#region src/react/settings/source-settings.tsx-function Hr({ data: e, receipt: t, panel: n }) {- let r = X({+function Hr({ data: e, receipt: t, panel: n, issues: r }) {+ let i = X({queryKey: E,queryFn: ({ signal: e }) => Ke(e),enabled: n?.active !== !1,@@ -3805,20 +3811,21 @@ function Hr({ data: e, receipt: t, panel: n }) {return /* @__PURE__ */ (0, $.jsxs)("div", {...Q(n),children: [+ r,/* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(f, {href: "/sources",variant: "secondary",children: "采集来源与登录状态"}) }),- r.data ? /* @__PURE__ */ (0, $.jsx)(Fr, {- data: r.data,+ i.data ? /* @__PURE__ */ (0, $.jsx)(Fr, {+ data: i.data,readOnly: !!e.ledger_read_only,toast: t,embedded: !0- }) : r.error ? /* @__PURE__ */ (0, $.jsx)(N, {+ }) : i.error ? /* @__PURE__ */ (0, $.jsx)(N, {tone: "error",title: "来源凭据未取得",- children: K(r.error)+ children: K(i.error)}) : n?.active === !1 ? null : /* @__PURE__ */ (0, $.jsx)(Ee, {label: "正在读取来源凭据",html: Ue@@ -3885,12 +3892,16 @@ function Kr({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r })queryKey: h,queryFn: ({ signal: e }) => Ge(e)}), a = i.data;- return a ? /* @__PURE__ */ (0, $.jsx)(Jr, {+ return a ? /* @__PURE__ */ (0, $.jsx)(Yr, {data: a,receipt: e,reopenTutorial: t,section: n,- diagnostics: r+ diagnostics: r,+ refreshing: i.isFetching,+ reload: () => {+ i.refetch({ cancelRefetch: !1 });+ }}) : /* @__PURE__ */ (0, $.jsx)("div", {className: "ui-configpage",children: /* @__PURE__ */ (0, $.jsx)(N, {@@ -3900,44 +3911,77 @@ function Kr({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r })})});}-var qr = 0;-function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i }) {- let [a] = (0, Z.useState)(() => `board-tabs-${++qr}`), [o, s] = (0, Z.useState)(r), c = (0, Z.useRef)(null), l = (0, Z.useRef)(o);+function qr({ data: e, sections: t, reload: n, refreshing: r }) {+ return /* @__PURE__ */ (0, $.jsx)($.Fragment, { children: t.map((t) => {+ let i = e.section_errors?.[t];+ return i ? /* @__PURE__ */ (0, $.jsx)(N, {+ tone: "error",+ title: i.title,+ action: /* @__PURE__ */ (0, $.jsx)(d, {+ variant: "secondary",+ size: "small",+ onClick: n,+ ...G(r),+ children: "重新读取"+ }),+ children: i.message+ }, t) : null;+ }) });+}+var Jr = 0;+function Yr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i, reload: a, refreshing: o }) {+ let [s] = (0, Z.useState)(() => `board-tabs-${++Jr}`), [c, l] = (0, Z.useState)(r), u = (0, Z.useRef)(null), d = (0, Z.useRef)(c);(0, Z.useEffect)(() => {- s(r);+ l(r);}, [r]), (0, Z.useEffect)(() => {let t = Ur(e);t && J("downloads", t), J("network", Wr(e)), J("maintenance", Gr(e));}, [e]), (0, Z.useLayoutEffect)(() => {- if (l.current === o) return;- l.current = o;- let e = c.current?.querySelector("[role=\"tablist\"]"), t = c.current?.querySelector(".ui-board-group-active");+ if (d.current === c) return;+ d.current = c;+ let e = u.current?.querySelector("[role=\"tablist\"]"), t = u.current?.querySelector(".ui-board-group-active");if (!e || !t) return;let n = parseFloat(getComputedStyle(e).top);if (!Number.isFinite(n) || e.getBoundingClientRect().top > n + 1) return;let r = matchMedia("(max-width:900px)").matches ? e.getBoundingClientRect().bottom + 8 : n;window.scrollTo(0, Math.max(0, window.scrollY + t.getBoundingClientRect().top - r));- }, [o]);- let u = (e) => {- s(e), ft(dt(e), {+ }, [c]);+ let f = (e) => {+ l(e), ft(dt(e), {replace: !0,state: rt.navigation.location.state});- }, [d, f] = (0, Z.useState)(() => matchMedia("(max-width:900px)").matches);+ }, [p, m] = (0, Z.useState)(() => matchMedia("(max-width:900px)").matches);(0, Z.useEffect)(() => {- let e = matchMedia("(max-width:900px)"), t = () => f(e.matches);+ let e = matchMedia("(max-width:900px)"), t = () => m(e.matches);return e.addEventListener("change", t), () => e.removeEventListener("change", t);}, []);- let p = (0, Z.useRef)([]), m = {+ let h = (0, Z.useRef)([]), g = {data: e,receipt: t- }, h = !!(e.peach_proxy || e.access || e.tunnel || e.editable && e.port_editable !== !1), g = e.downloads, _ = [+ }, _ = (t) => /* @__PURE__ */ (0, $.jsx)(qr, {+ data: e,+ sections: t,+ reload: a,+ refreshing: o+ }), v = [+ "peach_proxy",+ "access",+ "tunnel",+ "push_discovery",+ ...e.editable && e.port_editable !== !1 ? ["media_sources"] : []+ ], y = !!(e.peach_proxy || e.access || e.tunnel || e.editable && e.port_editable !== !1 || v.some((t) => e.section_errors?.[t])), b = e.downloads, x = [{title: "媒体库与入库",- body: (e) => /* @__PURE__ */ (0, $.jsxs)("div", {- ...Q(e),+ body: (n) => /* @__PURE__ */ (0, $.jsxs)("div", {+ ...Q(n),children: [- /* @__PURE__ */ (0, $.jsx)(er, { ...m }),+ _([+ "media_sources",+ "library_count",+ "mount_dependencies"+ ]),+ !e.section_errors?.media_sources && !e.section_errors?.library_count ? /* @__PURE__ */ (0, $.jsx)(er, { ...g }) : null,/* @__PURE__ */ (0, $.jsx)(_r, { receipt: t }),/* @__PURE__ */ (0, $.jsx)(ur, { receipt: t })]@@ -3946,23 +3990,26 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i{title: "来源与订阅",body: (e) => /* @__PURE__ */ (0, $.jsx)(Hr, {- ...m,- panel: e+ ...g,+ panel: e,+ issues: _(["entry_links"])})},- ...g ? [{+ ...b || e.section_errors?.downloads ? [{title: "下载渠道",body: (e) => /* @__PURE__ */ (0, $.jsx)(Yt, {- initial: g,+ initial: b,receipt: t,- panel: e+ panel: e,+ issues: _(["downloads"])})}] : [],- ...h ? [{+ ...y ? [{title: "网络与访问",body: (e) => /* @__PURE__ */ (0, $.jsx)(Dr, {- ...m,- panel: e+ ...g,+ panel: e,+ issues: _(v)})}] : [],{@@ -3970,10 +4017,21 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: ibody: (e) => /* @__PURE__ */ (0, $.jsxs)("div", {...Q(e),children: [- /* @__PURE__ */ (0, $.jsx)(xn, { ...m }),+ _([+ "startup",+ "uninstall",+ "storage",+ "remote_reporting",+ "library_sharing",+ "updates",+ "update_job",+ "automatic_updates",+ "facts"+ ]),+ /* @__PURE__ */ (0, $.jsx)(xn, { ...g }),/* @__PURE__ */ (0, $.jsx)(dr, { receipt: t }),/* @__PURE__ */ (0, $.jsx)(fn, {- ...m,+ ...g,reopenTutorial: n})]@@ -3986,17 +4044,17 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: ichildren: e.active ? i : null})}- ], v = Math.max(0, _.findIndex((e) => e.title === o)), y = (e, t) => {- let n = _.length - 1, r;+ ], S = Math.max(0, x.findIndex((e) => e.title === c)), ee = (e, t) => {+ let n = x.length - 1, r;if (e.key === "ArrowRight" || e.key === "ArrowDown") r = t === n ? 0 : t + 1;else if (e.key === "ArrowLeft" || e.key === "ArrowUp") r = t === 0 ? n : t - 1;else if (e.key === "Home") r = 0;else if (e.key === "End") r = n;else return;- e.preventDefault(), u(_[r].title), p.current[r]?.focus();+ e.preventDefault(), f(x[r].title), h.current[r]?.focus();};return /* @__PURE__ */ (0, $.jsxs)("div", {- ref: c,+ ref: u,className: "ui-configpage",children: [/* @__PURE__ */ (0, $.jsx)(be, {className: "ui-board-local-nav",@@ -4005,35 +4063,35 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i"data-section-nav": "","data-section-items": "","data-pill-nav": "",- "aria-orientation": d ? "horizontal" : "vertical",- children: _.map(({ title: e }, t) => /* @__PURE__ */ (0, $.jsx)("button", {+ "aria-orientation": p ? "horizontal" : "vertical",+ children: x.map(({ title: e }, t) => /* @__PURE__ */ (0, $.jsx)("button", {ref: (e) => {- p.current[t] = e;+ h.current[t] = e;},type: "button",role: "tab",- id: `${a}-tab-${t}`,- "aria-controls": `${a}-panel-${t}-0`,- "aria-selected": t === v,- "data-pill-selected": t === v ? "" : void 0,+ id: `${s}-tab-${t}`,+ "aria-controls": `${s}-panel-${t}-0`,+ "aria-selected": t === S,+ "data-pill-selected": t === S ? "" : void 0,"data-pill-variant": "gray",- tabIndex: t === v ? 0 : -1,- onClick: () => u(e),- onKeyDown: (e) => y(e, t),+ tabIndex: t === S ? 0 : -1,+ onClick: () => f(e),+ onKeyDown: (e) => ee(e, t),children: e}, e))- }), _.map(({ title: e, body: t }, n) => /* @__PURE__ */ (0, $.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("h2", {+ }), x.map(({ title: e, body: t }, n) => /* @__PURE__ */ (0, $.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("h2", {className: "ui-configgroup",children: e}), t({index: n,- id: `${a}-panel-${n}-0`,- labelledBy: `${a}-tab-${n}`,- active: n === v+ id: `${s}-panel-${n}-0`,+ labelledBy: `${s}-tab-${n}`,+ active: n === S})] }, e))]});}//#endregionexport { Kr as ConfigurationPage };-//# debugId=78aa664a-ede9-4231-94fa-85a243e03341\ No newline at end of file+//# debugId=de944ccb-4459-4af8-9b8c-e6c4d4ff544a\ No newline at end of filediff --git a/web/dist/peach-app.js b/web/dist/peach-app.jsindex 0a02b9d7f..ec769bb49 100644--- a/web/dist/peach-app.js+++ b/web/dist/peach-app.js@@ -2,7 +2,7 @@(function() {try {var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e51ad429-7728-473f-ac70-484fe2795a25", e._sentryDebugIdIdentifier = "sentry-dbid-e51ad429-7728-473f-ac70-484fe2795a25");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e7b5af0c-3fac-45f4-afd4-c80d34869301", e._sentryDebugIdIdentifier = "sentry-dbid-e7b5af0c-3fac-45f4-afd4-c80d34869301");} 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), e = null), t.exports), s = (e, n) => {@@ -74804,7 +74804,7 @@ async function _6(e, t) {if (n.status === "rejected") throw n.reason;}var v6 = g6(() => import("./peach-app.jav-page-B55byEeQ.js")), y6 = g6(() => import("./peach-app.stats-page-Dl0lm7Yt.js")), b6 = g6(() => import("./peach-app.taste-page-CidGJvZ7.js")), x6 = g6(() => import("./peach-app.review-page-CPsgIxd6.js")), S6 = g6(() => import("./peach-app.data-cleanup-page-DPCNx1GU.js")), C6 = g6(() => import("./peach-app.duplicates-page-CoHPntSW.js")), w6 = g6(() => import("./peach-app.quality-goals-page-CjcBIXAC.js")), T6 = g6(() => import("./peach-app.scraping-page-DM0a_K9-.js")), E6 = g6(async () => {- let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-Bxq5ZZc_.js"), import("./peach-app.diagnostics-page-bdA2qUuj.js")]);+ let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-CZadQb1A.js"), import("./peach-app.diagnostics-page-bdA2qUuj.js")]);return {ConfigurationPage: e,DiagnosticsPage: t@@ -80072,4 +80072,4 @@ BNe($9);//#endregionexport { FI as $2ec61d1d4f780267$export$a8a3e93435678ff9, UI as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, oR as $542a13ca2fa5b484$export$5b6b19405a83ff9d, Jw as $72abaeab4d80592f$export$78efe591171d7d45, QR as $76d00c5a4edb230a$export$76ccd210b9029917, YR as $76d00c5a4edb230a$export$816b5d811295e6bc, tz as $76d00c5a4edb230a$export$b59bdbef9ce70de2, rz as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, JR as $76d00c5a4edb230a$export$f850895b287ef28e, Fde as $b4f18e3395fe64d7$export$3d96ec278d3efce4, Pde as $b4f18e3395fe64d7$export$3e41faf802a29e71, jde as $b4f18e3395fe64d7$export$b2539bed5023c21c, sz as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, Rde as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, FC as $ea3928288112382f$export$439d29a4e110a164, yR as $f2ff30fde7b014be$export$3ddf2d174ce01153, ER as $fe21c36db05242bb$export$a98f0dcb43a68a25, DR as $fe21c36db05242bb$export$d7b12c4107be0d61, bfe as $l, AA as ACCENT_CHOICES, xwe as AMANE_BRIDGE_CHECK_URL, Z$ as AMANE_BRIDGE_KEY, Swe as AMANE_BRIDGE_REBUILD_URL, kn as ApiError, vW as ArtSlot, q as Button, pI as ButtonLink, kfe as Bx, Vt as CLOUD_LOCATIONS, Z1 as CLOUD_PROXY_HELP, mr as COLUMN_SORT, l1 as CONFIGURATION_KEY, tX as CONFIGURATION_URL, Cwe as COOKIE_TEXT_LIMIT, X$ as COVER_JOB_KEY, _i as CREDENTIAL_STATE, K$ as CUSTOM_SOURCES_KEY, G$ as CUSTOM_SOURCES_URL, oV as Checkbox, aV as CheckboxGlyph, XB as ChevronSortDown, hZ as Chip, q2 as CloudDownloadDialog, HH as CollapseChevron, VH as CollapseRegion, p$ as CollectionSummary, eye as DEFAULT_CATEGORY, Nn as DEFAULT_SORT, LQ as DIAGNOSTICS_KEY, Zye as DIRECTORY_TEMPLATE_ERROR, M0 as DISCOVERY_SORTS, V2 as DOWNLOADS_KEY, B2 as DOWNLOADS_URL, TY as DUPLICATES_KEY, cY as DataTableFooter, iY as DataTableFrame, sY as DataTableSort, YH as Disclosure, jDe as DownloadsPanel, dfe as E3, tye as ENTITY_REVIEW_KINDS, Y1 as ENTRY_LINKS_HELP, X1 as ENTRY_LINKS_HINT, Cfe as Ea, Bfe as EmptyFocusButton, zz as EmptyState, qH as ErrorText, yhe as ExternalLink, lr as FEEDS_KEY, lX as FEED_SCHEDULE_KEY, Ake as FLOW_LABEL_X, L3 as FLOW_VIEWBOX, sr as FOLLOW_CHECK_KEY, or as FOLLOW_CREDENTIALS_KEY, M8 as FOLLOW_INITIAL_RANGE_OPTIONS, ar as FOLLOW_MANAGE_KEY, cr as FOLLOW_RESOLVE_KEY, cX as FOLLOW_SCHEDULE_KEY, xhe as Fact, bhe as FactList, JH as FieldLabel, R$ as Fieldset, L$ as FieldsetTitle, Mle as FilterGlass, oI as FilterGlassRows, aI as FilterIconButton, sI as FilterPill, vhe as Footer, Cz as Gg, cI as GlassPill, KH as Help, Az as HintText, Ske as IDLE_POLL_MS, Uve as IDLE_REPAIR, tI as IconButton, Fz as Input, Pz as InputBase, tA as JAV_LAYOUTS, P0 as JAV_RECOMMENDATION_GRID, MX as JUNK_KEY, X3 as JavHeader, Lve as KEEP_LABELS, dr as LAYOUTS, J1 as LIBRARY_FOLDER_HELP, pH as LIBRARY_PROCESSING_KEY, qY as LINKS_KEY, JY as LINK_CHECK_KEY, Cye as LINK_KINDS, YY as LINK_PRUNE_KEY, wn as LOC, kz as Label, V$ as LibraryProcessingCard, nB as LibraryShortcuts, wH as LinkButton, IH as LoadingDots, pfe as M6, Oye as MEDIA_PROCESSING_KEY, dX as MEDIA_PROCESSING_URL, AY as MEDIA_REPAIR_KEY, kY as MEDIA_REPAIR_URL, Vn as MEDIA_SOURCES_KEY, Po as MEDIA_SOURCE_ICONS, zt as MEDIA_SOURCE_OPTIONS, eV as MENU_ITEM, tV as MENU_ITEM_INTERACTIVE, $B as MENU_POPOVER_SURFACE, EH as MenuDialog, mG as MixCard, Iz as ModalFrame, hv as MotionConfigContext, Oz as NR, Rz as Note, Ife as OA, mX as ORGANIZE_KEY, _X as ORPHAN_RECORDS_KEY, Sz as OV, hz as P7, zCe as PHASES, nX as PICK_FOLDER_URL, U$ as PLAYLISTS_KEY, CTe as POLICY_COLUMNS, TTe as POLICY_COVER_NOTE, wTe as POLICY_MATRIX, q1 as POLICY_SUMMARY, oY as Pagination, B$ as PathLine, MF as PillTabList, RH as Progress, FY as QUALITY_GOALS_KEY, j$ as REPAIR_CARD_TEXT, jY as REPAIR_LIBRARIES_KEY, SX as RESOURCE_APPLY_KEY, xX as RESOURCE_SCAN_KEY, QCe as RESULT_PANEL, $Ce as RESULT_SECTION, $ve as REVIEW_CATEGORIES, jX as REVIEW_COUNTS_KEY, RY as REVIEW_KEY, zY as REVIEW_LABELS, _W as RetryNote, Ffe as Rf, ghe as Rows, ywe as SCRAPING_CHECK_URL, J$ as SCRAPING_COVER_URL, Y$ as SCRAPING_KEY, vwe as SCRAPING_SETTINGS_URL, CU as SEGMENT, SU as SEGMENTED_TRACK, sX as SETTINGS_KEY, rX as SETTINGS_URL, Pn as SORT_DEFAULT_DIR, Mn as SORT_OPTIONS, Ht as SOURCE_LABELS, c3 as STATS_KEY, hhe as Section, _he as SectionSkeleton, xU as SegmentedRadioGroup, age as SegmentedTabList, YU as Segments, aY as Select, mU as Select$1, p1 as SelectField, hU as SelectItem, hk as SelectionDock, UH as SettingsCard, mhe as SettingsRow, WH as SettingsSectionLabel, The as SiteLabel, OU as SortDirectionIcon, QU as SortKeys, bQ as SourceAvatar, $H as SourceLabel, XH as SourceMark, GH as Stack, z$ as StatusLabel, P2 as Switch, VF as TASKS_KEY, dke as TASTE_REFRESH_KEY, fke as TASTE_WINDOWS, uX as THUMBNAIL_JOBS_KEY, PX as TRASH_KEY, fle as TRIGGER_LABELS, YJ as Table, hY as TableColumnControls, gY as TableColumnResizer, vY as TableSelectionHeader, zH as TaskProgress, Mz as TextField, jz as TextFieldContext, xz as Un, _$ as WANTS_KEY, r4 as WantMagnets, Yf as WithPromise, gz as Wt, bz as Xc, Dz as Xf, hfe as Xt, ffe as _8, o as __commonJSMin, s as __exportAll, l as __toESM, Pfe as aB, Jr as addAlias, qr as addSource, y$ as addWant, B as apiGet, V as apiSend, Yk as appSettingsStore, gbe as applyConfirmText, AX as applyLeftovers, hbe as applyPlanText, vbe as applyText, $k as applyTheme, qg as asNumber, ibe as attachOrphan, Ar as authorAvatar, Mr as authorGroups, kr as authorInitial, Or as authorName, jq as autoResetPageIndex, Ra as avatarInner, m3 as bandRows, Qye as baseName, Hve as batchOperate, bk as boundedPreference, zve as bulkCloudPreferences, Uz as busyProps, Nfe as cB, VDe as cachedMagnetStates, zf as calcGeneratorVelocity, sye as canApprove, uf as cancelFrame, lbe as candidateText, FH as cardClass, mA as cardRatio, yz as cc, pi as checkEvidenceGap, fi as checkFailures, ri as checkFeeds, Dye as checkLine, ui as checkReceipt, di as checkSummary, Twe as checkText, mi as checkedText, BW as clickedBlank, jve as cloudLocations, O0 as cloudProxySkeleton, ax as clsx, Efe as cn, Gm as collectMotionValues, rJ as columnVisibilityFeature, WJ as column_getCanSort, BJ as column_getSortFn, aye as commonReviewSources, uV as configurationSection, gke as configureTasteBrowser, Sc as confirmModal, eq as copyInstancePropertiesWithoutMemos, ja as coverUrl, Jq as createColumnHelper, fwe as createPlaylist, vi as credentialDone, w0 as credentialsSkeleton, gye as currentReviewRow, kF as cx, Tz as dZ, pye as decisionPayload, mye as decisionReceipt, fye as defaultChoice, mwe as deletePlaylist, K1 as diagnosticsSkeleton, qCe as discoveryArtwork, w$ as discoveryKey, YTe as discoveryScore, Fve as distinctName, yye as dropReviewRows, ci as dropSources, Mfe as du, Bve as duplicateVictims, JF as elapsedText, La as entityFaceImg, tn as entityPath, Cr as errorHeadline, jn as errorMessage, z as esc, kq as expandRowModel, fz as f1, Sr as feedIntervalText, e1 as fetchAmaneBridge, Br as fetchCheckJob, u1 as fetchConfiguration, $$ as fetchCoverJob, zr as fetchCredentials, q$ as fetchCustomSources, RQ as fetchDiagnostics, T$ as fetchDiscoveries, DY as fetchDuplicates, sle as fetchEarlier, jye as fetchFeedSchedule, ei as fetchFeeds, Rr as fetchFollow, Aye as fetchFollowSchedule, IX as fetchJunkSummary, QY as fetchLinkCheck, $Y as fetchLinkPrune, ZY as fetchLinkStats, kye as fetchMediaProcessing, MY as fetchMediaRepair, Hn as fetchMediaSources, hX as fetchOrganize, Wye as fetchOrganizeExample, vX as fetchOrphanRecords, $r as fetchPending, W$ as fetchPlaylists, IY as fetchQualityGoals, NY as fetchRepairLibraries, Vr as fetchResolveJob, wX as fetchResourceApply, CX as fetchResourceScan, WY as fetchReview, FX as fetchReviewCounts, fX as fetchSettings, Q$ as fetchSources, l3 as fetchStats, Hr as fetchSuggestions, UF as fetchTasks, P3 as fetchTaste, _ke as fetchTasteJob, Mye as fetchThumbnailJobs, LX as fetchTrashSummary, v$ as fetchWants, rye as filterReviewRows, Sn as firstGrapheme, bK as flexRender, Mke as flowGraph, Nke as flowLabel, jOe as fmtCount, gn as fmtDur, vn as fmtSize, xle as foldRoutine, ai as followFeedByName, ur as followSuggestKey, Cle as followupDetail, lf as frame, nfe as g4, oJ as getDefaultPaginationState, pA as gridLayout, jr as groupByAuthor, ble as groupFollowups, VY as groupReviewRows, pbe as hasChanges, TX as hasResourceRoots, GF as hasResultProblems, Cke as historySpan, pz as i2, xke as importTasteExport, T0 as indexersSkeleton, jf as interpolate, x$ as invalidateWants, qF as isActive, xr as isBroken, hr as isLayout, gh as isMotionValue, BY as isReviewCategory, Sle as isRoutine, E0 as javBrowserSkeleton, I0 as javContentSkeleton, oA as javLayout, F0 as javTagSkeleton, Cbe as junkBreakdown, hwe as keepPlaylist, ve as keepPreviousData, Fr as keepSelected, u3 as known, ofe as l7, yle as latestOfKind, UOe as lengthRows, Gn as localTime, ii as lookupFeedActor, lfe as m7, wz as mM, Jt as mapLimit, Qr as markItem, h3 as max, VOe as mediumRows, cle as mergeFinished, g3 as min, xye as mirrorText, Kve as missingToolText, OY as mixedCloudPreferences, QF as momentText, Dy as motion, qm as motionValue, ebe as organizeOutcome, Q0 as overlayHost, gr as pageSizeOf, Pr as pageWindow, Ln as paginationRange, si as patchSource, QV as peachHistory, QV as peachHistory$1, dye as pendingGenres, NOe as percentText, qye as pickOrganizeFolder, $ye as planSummary, d3 as playedFor, FOe as playedItemUrl, HF as pollInterval, fs as popCount, dwe as posterUrl, IW as previewLibraryColor, Kye as previewOrganize, Yve as previewUrl, vle as problemDestination, YF as progressText, QH as providerIcon, Eye as pruneText, DX as purgeCount, abe as purgeOrphan, Ez as pv, jfe as qE, H as queryClient, mz as r2, kke as radarRows, ROe as radialArc, zOe as radialBarSize, LOe as radialCeiling, IOe as radialSlices, Ej as randomId, Dke as rankDetail, Oke as rankShares, p3 as reachedShare, XF as readableErrorHeadline, XTe as recommendationScore, _ye as recordGenre, sbe as recordsText, gwe as recreatePlaylist, lwe as refreshPlaylists, nl as relayoutCovers, li as reloadFollowManage, bye as reloadReview, OTe as rememberShape, Yye as rememberTemplates, Yr as removeAlias, ni as removeFeed, Kr as removeSource, bke as removeTasteSource, b$ as removeWants, Xr as renameAliasGroup, pwe as renamePlaylist, GOe as replayRows, E as require_jsx_runtime, v as require_react, S as require_react_dom, UK as require_with_selector, HCe as resetWants, In as resolveFollowSort, Gf as resolveStartTime, uwe as resumeAssetId, nye as reviewGroupingOptions, Sbe as reviewSummary, iye as reviewWindow, lye as rowEvidence, UY as rowFieldName, pJ as rowPaginationFeature, PJ as rowSelectionFeature, qJ as rowSortingFeature, HY as rowSubject, uye as rowTags, cye as rowTitle, rfe as s5, Zr as saveCredential, mbe as scanLine, Lye as schedulePollInterval, WCe as searchNote, oye as selectReviewRange, Ir as selectionState, ti as setFeedEnabled, Gr as setSourceEnabled, mV as settingsPath, Pve as sharedNamePrefix, $V as shellNavigate, y8 as showToast, cn as siteMarkUrl, pq as skipFirstRun, AF as sortCx, vr as sortLabel, Ut as sourceDefaultCost, gi as sourceIconUrl, _be as sourceMeta, rs as spinnerHtml, Of as spring, Vz as spriteGlyph, Ur as startCheck, wye as startLinkCheck, Tye as startLinkPrune, Jye as startOrganize, Wr as startResolve, dbe as startResourceApply, ube as startResourceScan, yke as startTasteRefresh, mle as statusLabel, Gve as statusLine, br as statusText, hA as storeJavLayout, hye as submitDecision, $F as summaryItems, Yq as tableFeatures, mq as tableMemo, Nr as tableRows, _le as taskIssues, F3 as tasteDate, Tke as tasteDimensions, wke as tasteHours, N3 as tasteKey, mke as tasteRefetchInterval, hke as tasteTime, IF as textLang, Wu as time, yfe as tl, Lr as toggleGroup, I3 as topScores, Sfe as uo, NH as useAction, RZ as useBackgroundJob, nu as useConstant, iI as useHorizontalScroller, ru as useIsomorphicLayoutEffect, RW as useLibraryTints, wt as useMutation, sV as useOverlayScrollbar, Ct as useQuery, A as useQueryClient, vy as useReducedMotion, Iye as useRunSchedule, Pye as useSaveFollowSchedule, pX as useSaveSettings, Rye as useSaveThumbnailMode, JJ as useTable, dY as useTablePreferences, Vve as victimBytes, UCe as wantName, POe as watchNote, f3 as watchedShare, Us as wireHorizontalScroller, Xye as withOrganizeJob };-//# debugId=e51ad429-7728-473f-ac70-484fe2795a25\ No newline at end of file+//# debugId=e7b5af0c-3fac-45f4-afd4-c80d34869301\ No newline at end of file