Peach: Local-first video metadata scraper and media manager.
fix(cache): 修正结果缓存的版本键与读表声明
longmeidaoc3ca404c4ecd
diff --git a/frontend/src/react/taste/taste-page.tsx b/frontend/src/react/taste/taste-page.tsxindex b18bcd704..308e6bffb 100644--- a/frontend/src/react/taste/taste-page.tsx+++ b/frontend/src/react/taste/taste-page.tsx@@ -433,6 +433,12 @@ export function TastePage(props: TasteProps) {toast(state.warnings?.length ? '部分浏览记录未取得' : '已更新口味分析');},});+ /* 重算失败后服务端暂不再算,页面也停了轮询。「立即重试」让服务端跳过等待再算一次,回来的+ 那一份换进它所属范围的缓存:算完就是新结果,还在算就带着 `stale` 接着轮询。 */+ const retry = useMutation({+ mutationFn: (window: string) => fetchTaste(window, undefined, true),+ onSuccess: (result, window) => { queryClient.setQueryData(tasteKey(window), result) },+ });const load = useMutation({mutationFn: (chosen: File) => importTasteExport(chosen),onSuccess: (result) => {@@ -480,6 +486,7 @@ export function TastePage(props: TasteProps) {const identified = coverage.identified || 0;const problem = refresh.error ? errorMessage(refresh.error): load.error ? errorMessage(load.error)+ : retry.error ? errorMessage(retry.error): outcome?.status === 'failed' ? (outcome.error || '读取未取得'): '';@@ -522,7 +529,12 @@ export function TastePage(props: TasteProps) {{running ? <TaskProgress label={job?.message || '正在读取浏览记录并更新口味分析'}value={job?.checked} total={job?.total} /> : null}{load.isPending ? <TaskProgress label="正在导入口味数据" /> : null}- {data.stale ? <TaskProgress label={`正在更新口味分析,当前显示 ${tasteTime(data.computed_at)} 的结果`} /> : null}+ {data.stale && data.error ? (+ <Note tone="error" action={<Button variant="secondary" size="small"+ {...busyProps(retry.isPending)} onClick={() => retry.mutate(range)}>立即重试</Button>}>+ {`口味分析更新失败,当前显示 ${tasteTime(data.computed_at)} 的结果。${data.error}`}+ </Note>+ ) : data.stale ? <TaskProgress label={`正在更新口味分析,当前显示 ${tasteTime(data.computed_at)} 的结果`} /> : null}{problem ? <Note tone="error">{problem}</Note> : null}{outcome?.warnings?.length ? <Note tone="warning">{outcome.warnings.join(';')}</Note> : null}</div>diff --git a/frontend/src/react/taste/taste.ts b/frontend/src/react/taste/taste.tsindex 3bc3d0efb..5b6507c38 100644--- a/frontend/src/react/taste/taste.ts+++ b/frontend/src/react/taste/taste.ts@@ -118,14 +118,16 @@ export interface TasteData {computed_at?: string | null;/** 服务端正在后台重算,这一份是上一次的结果。 */stale?: boolean;+ /** 和 `stale` 同时出现:这一次重算失败了,服务端暂不再算,等「立即重试」。 */+ error?: string;}/** 看板在后台重算时隔这么久再问一次,算完换上新结果。 */export const STALE_POLL_MS = 2_000;-/** `stale` 时的轮询间隔:只在服务端说「这是旧的」时才问,算完就停。 */+/** `stale` 时的轮询间隔:只在服务端说「这是旧的」时才问,算完或算失败就停。 */export const tasteRefetchInterval = (data: TasteData | undefined): number | false =>- (data?.stale ? STALE_POLL_MS : false);+ (data?.stale && !data.error ? STALE_POLL_MS : false);/** 快照时刻,精确到分钟:重算通常几秒内完成,只写日期看不出是哪一份。 */export const tasteTime = (value: string | null | undefined): string =>@@ -158,8 +160,9 @@ export interface TasteJob {warnings?: string[];}-export const fetchTaste = (window: string, signal?: AbortSignal) =>- apiGet<TasteData>(`${TASTE_URL}?window=${window}`, signal);+/** `retry` 让服务端跳过失败后的等待,立刻重算一次。 */+export const fetchTaste = (window: string, signal?: AbortSignal, retry = false) =>+ apiGet<TasteData>(`${TASTE_URL}?window=${window}${retry ? '&retry=1' : ''}`, signal);export const fetchTasteJob = (signal?: AbortSignal) =>apiGet<TasteJob>(TASTE_REFRESH_URL, signal);diff --git a/frontend/test/react/taste.test.tsx b/frontend/test/react/taste.test.tsxindex 773775cb6..737f99094 100644--- a/frontend/test/react/taste.test.tsx+++ b/frontend/test/react/taste.test.tsx@@ -15,7 +15,7 @@ import { JOB_RUNNING_POLL_MS } from '../../src/react/background-job';import { queryClient } from '../../src/react/query';import {DEFAULT_WINDOW, FLOW_VIEWBOX, flowGraph, historySpan, prefetchTaste, radarRows, RANK_MAX, rankDetail,- TASTE_IMPORT_URL, TASTE_REFRESH_URL, TASTE_SOURCE_URL, TASTE_URL, tasteDimensions, topScores,+ STALE_POLL_MS, TASTE_IMPORT_URL, TASTE_REFRESH_URL, TASTE_SOURCE_URL, TASTE_URL, tasteDimensions, topScores,type TasteData, type TasteJob,} from '../../src/react/taste/taste';import { TasteRadar } from '../../src/react/taste/charts';@@ -267,6 +267,35 @@ it('换分析范围时留住上一份:这一屏不退回等待态,只等新expect(host.querySelector('[role=alert]')).toBeNull();});+it('后台重算时隔一会儿再问,算完换上新结果就停', async () => {+ vi.useFakeTimers();+ const { fetcher, host } = await open({ taste: [payload({ stale: true }), payload()] });+ expect(host.textContent).toContain('正在更新口味分析');+ await tick(STALE_POLL_MS);+ await settle();+ expect(tasteGets(fetcher)).toHaveLength(2);+ expect(host.textContent).not.toContain('正在更新口味分析');+ await tick(STALE_POLL_MS * 3);+ expect(tasteGets(fetcher)).toHaveLength(2);+});++it('重算失败时不再轮询,提示条说明更新失败,「立即重试」让服务端跳过等待再算一次', async () => {+ vi.useFakeTimers();+ const failed = payload({ stale: true, error: '账本读取失败', computed_at: '2026-09-10T00:00:00Z' });+ const fresh = payload({ summary: { history_visits: 4321, history_sources: 2 } });+ const { fetcher, host } = await open({ taste: [failed, fresh] });+ expect(host.textContent).toContain('口味分析更新失败');+ expect(host.textContent).toContain('账本读取失败');+ expect(host.textContent).not.toContain('正在更新口味分析');+ await tick(STALE_POLL_MS * 3);+ expect(tasteGets(fetcher), '失败之后还在轮询').toHaveLength(1);+ await click(rowNamed(host, '立即重试'));+ await settle();+ expect(String(tasteGets(fetcher).at(-1)?.[0])).toBe(`${TASTE_URL}?window=all&retry=1`);+ expect(host.textContent).not.toContain('口味分析更新失败');+ expect(host.textContent).toContain('4,321');+});+it('首屏读到的旧终态不冒充新结果:不发回执,也不重取 dashboard', async () => {const { fetcher, props, host } = await open({ job: [{ status: 'complete' }] });expect(props.toast).not.toHaveBeenCalled();diff --git a/src/peach/taste_history.py b/src/peach/taste_history.pyindex a4e5e5fcf..a303a1d1e 100644--- a/src/peach/taste_history.py+++ b/src/peach/taste_history.py@@ -14,10 +14,10 @@ import sysimport timefrom collections import Counter, defaultdictfrom contextlib import closing, contextmanager-from dataclasses import dataclass+from dataclasses import dataclass, replacefrom datetime import UTC, datetime, timedelta, timezonefrom html.parser import HTMLParser-from itertools import chain+from itertools import chain, countfrom functools import lru_cachefrom pathlib import Pathfrom urllib.parse import parse_qs, unquote, urlparse@@ -741,12 +741,17 @@ class _HistoryRows:taste: tuple[_TasteVisit, ...]identity_visits: tuple[tuple[str, str, str], ...] = ()bookmarks: tuple[tuple[str, str, str], ...] = ()+ #: 读出这些行时历史库的版本(`store_version`)。按行派生的缓存拿它作键,+ #: 不另读一次:另读的那次可能已经是下一次写入之后的版本。+ version: tuple = ()#: 按历史库文件的版本缓存解析结果。历史库只在导入与刷新时变,逐条解析网址要十几秒;#: 账本写入与它无关,不该连带重算。键里带 `-wal` 的版本:WAL 模式下写入先落在那里。_HISTORY_ROWS: dict[tuple, _HistoryRows] = {}_PREFERENCE_VISITS: dict[tuple, tuple[tuple[str, str, str], ...]] = {}+#: 读的途中历史库被写过的那几次读,各领一个序号作版本,见 `_history_rows`。+_UNSETTLED_READS = count()def store_version(store_path: Path) -> tuple:@@ -872,12 +877,20 @@ def _read_history_rows(store_path: Path) -> _HistoryRows | None:def _history_rows(store_path: Path) -> _HistoryRows | None:+ """历史库解析结果,`version` 是读之前取的版本。++ 读的途中历史库被写(口味刷新逐个来源提交)的话,读前读后两个版本对不上,这份结果+ 不进缓存,版本也换成只属于它自己的一个值,按版本取键的派生缓存不会拿别的行命中它。+ """version = store_version(store_path)cached = _HISTORY_ROWS.get(version)if cached is None:cached = _read_history_rows(store_path)if cached is None:return None+ if store_version(store_path) != version:+ return replace(cached, version=(*version, "unsettled", next(_UNSETTLED_READS)))+ cached = replace(cached, version=version)# 只留最新一版:旧版本的键再也不会被问到。_HISTORY_ROWS.clear()_HISTORY_ROWS[version] = cached@@ -1319,7 +1332,9 @@ def _linked_signals(history_store, cached, ledger_connection):index = IdentityIndex(ledger_connection)# 判据读到的账本只有这几样:实体的种类与规范名、别名、身份链接与关注来源推出的账号、# 排除的男优。取值本身进键,不用账本版本号——关注检查每小时都写账本,身份却很少变。- key = (store_version(history_store),+ # 历史库那一半用这些行读出时的版本:此刻再读一次可能已是新版本,旧行算出的信号存到+ # 新版本下,之后新行命中它就会按位置错配。+ key = (cached.version,tuple(sorted((eid, row["kind"], row["canonical_name"]) for eid, row in index.entities.items())),tuple(sorted((kind, label, tuple(sorted(ids))) for (kind, label), ids in index.aliases.items())),tuple(sorted((identity, tuple(sorted(values))) for identity, values in accounts.items())),diff --git a/src/peach/web_catalog.py b/src/peach/web_catalog.pyindex 48dc429d7..4e6abaaac 100644--- a/src/peach/web_catalog.py+++ b/src/peach/web_catalog.py@@ -1293,9 +1293,10 @@ def q_tops(contract: WebContract, n=28, jav=False, seed="", state="", page=0, fi#: 筛选项读到的账本表(不含实体范围与搜索词那几条分支,它们不走按版本的缓存):-#: 作品与实体、标签隐藏偏好、「已标记」「稍后看」两种状态,以及在线卡片的关注标签。-FACETS_TABLES = GROUP_TABLES + ("asset_tag_preference", "asset_preference", "watch_queue",- "follow_item", "follow_source")+#: 作品与实体、标签隐藏偏好与标签实体的别名(`tag_not_hidden`)、「已标记」「稍后看」两种+#: 状态,以及在线卡片的关注标签。+FACETS_TABLES = GROUP_TABLES + ("entity_alias", "asset_tag_preference", "asset_preference",+ "watch_queue", "follow_item", "follow_source")def q_facets(diff --git a/src/peach/web_follow.py b/src/peach/web_follow.pyindex 3838b0c26..02711e45c 100644--- a/src/peach/web_follow.py+++ b/src/peach/web_follow.py@@ -19,6 +19,7 @@ import uuidimport urllib.parsefrom pathlib import Path+from typing import NamedTuplefrom . import avatar_face, follow_assets, follow_creators, follow_providers, wantsfrom .follow import FollowSourceError@@ -900,15 +901,10 @@ def cover_alternatives(contract, item_id: int) -> tuple[str, ...]:def _cover_alternative_index(contract) -> dict[int, tuple[str, ...]]:"""每条 Rule34Video 条目 → 同组其他 Rule34Video 版本的 poster 地址,整库分组一次建好。"""with contract.database.read_connection() as connection:- store = _store(contract, connection)- sources = store.sources()- aliases, _ = store.author_aliases()- enabled = {int(source["id"]) for source in sources if source["enabled"]}- everything = contract.cached_until_changed(- "follow-items:None", lambda: tuple(item for item in store.items(limit=_ALL_ITEMS)- if item.source_id in enabled and not _excluded_item(item)))+ inputs = _follow_inputs(contract, connection)+ everything = _enabled_items(contract, inputs, None)index: dict[int, tuple[str, ...]] = {}- for group in store.group(everything, group_authors(sources, aliases)):+ for group in inputs.store.group(everything, group_authors(inputs.sources, inputs.alias_map)):members = [member for member in (group.primary, *group.variants, *group.duplicates)if member.provider == "rule34video"]for member in members:@@ -1336,7 +1332,7 @@ def _follow_facets(store, items, by_source, alias_map, icon_root=None, tag_polic}-def _author_facets(contract, store, everything, by_source, alias_map, args, scope, tag_policy=None) -> dict:+def _author_facets(contract, inputs, everything, by_source, args, scope) -> dict:"""只按一位作者算的筛选项,创作者资料页的在线视图读它(ADR-0096)。`facets` 按全库算,摆到一位创作者的资料页上就混进了别人的标签与来源。这一份只看这位@@ -1347,11 +1343,12 @@ def _author_facets(contract, store, everything, by_source, alias_map, args, scopauthors = _csv_values(args.get("author"))if summary or len(authors) != 1:return {}- matches = _follow_matcher({"author": authors[0]}, by_source, alias_map)+ matches = _follow_matcher({"author": authors[0]}, by_source, inputs.alias_map)return contract.cached_until_changed(f"follow-author-facets:{source_id}:{authors[0]}",- lambda: _follow_facets(store, tuple(item for item in everything if matches(item)),- by_source, alias_map, tag_policy=tag_policy))+ lambda: _follow_facets(inputs.store, tuple(item for item in everything if matches(item)),+ by_source, inputs.alias_map, tag_policy=inputs.tag_policy),+ inputs.revision, tables=FOLLOW_GROUP_TABLES)def _follow_tag_index(store, items, tag_policy=None, *, evidence=False) -> list[dict]:@@ -1720,17 +1717,53 @@ def q_follow_suggest(contract, q: str, limit: int = MAX_SUGGESTIONS,FOLLOW_GROUP_TABLES = ("follow_item", "follow_source", "follow_author_alias", "entity", "profile")-def _item_groups(contract, store, everything, by_author, source_id) -> dict:+class _FollowInputs(NamedTuple):+ """关注页几份缓存共用的输入,以及读它们之前取的 `FOLLOW_GROUP_TABLES` 版本号。"""++ store: FollowStore+ sources: list+ alias_map: dict+ author_aliases: list+ tag_policy: OnlineTagPolicy+ revision: int | None+++def _follow_inputs(contract, connection) -> _FollowInputs:+ """来源、作者别名与标签归类先于缓存从库里取出,再被闭包带进各份缓存的计算。++ 缓存自己的版本号在计算前才读,比这几样输入晚。两次读之间有写入的话,旧输入算出的+ 结果会记在新版本下一直命中。所以版本号在读输入之前先取一次,作为这几份缓存的额外+ 输入:期间有写入,两个版本号对不上,下一次请求照样重算。+ """+ revision = contract.ledger_revision(FOLLOW_GROUP_TABLES)+ store = _store(contract, connection)+ sources = store.sources()+ alias_map, author_aliases = store.author_aliases()+ return _FollowInputs(store, sources, alias_map, author_aliases,+ OnlineTagPolicy(connection), revision)+++def _enabled_items(contract, inputs, source_id) -> tuple:+ """启用来源下的全部条目(可限定一个来源),关注页与封面候选共用这一份缓存。"""+ enabled = {int(row["id"]) for row in inputs.sources if row["enabled"]}+ return contract.cached_until_changed(+ f"follow-items:{source_id}",+ lambda: tuple(item for item in inputs.store.items(source_id=source_id, limit=_ALL_ITEMS)+ if item.source_id in enabled and not _excluded_item(item)),+ inputs.revision, tables=FOLLOW_GROUP_TABLES)+++def _item_groups(contract, inputs, everything, by_author, source_id) -> dict:"""条目 id → 它所在的整组。直达详情查这一份,整库只分一次组,按账本版本缓存。组是读时拼的(剥作者名、相似标题),只按库里同键去捞会漏掉别的站上那几份,详情就比列表里的卡片少,所以还是整库分组。"""def build():- return {member.id: group for group in store.group(everything, by_author)+ return {member.id: group for group in inputs.store.group(everything, by_author)for member in (group.primary, *group.variants, *group.duplicates)}return contract.cached_until_changed(- f"follow-item-groups:{source_id}", build, tables=FOLLOW_GROUP_TABLES)+ f"follow-item-groups:{source_id}", build, inputs.revision, tables=FOLLOW_GROUP_TABLES)def _item_page(group, payload, sources, author_aliases) -> dict:@@ -1747,23 +1780,25 @@ def _ranked_cache_key(args, source_id, statuses, sort, direction) -> str | None:return f"follow-ranked:{source_id}:{','.join(statuses)}:{sort}:{direction}"-def _page_facets(contract, store, everything, by_source, alias_map, args, scope, tag_policy, offset) -> dict:+def _page_facets(contract, inputs, everything, by_source, args, scope, offset) -> dict:"""筛选项按全库算,只随首页下发:页面把几页并成一份时缺的键沿用首页那份(`mergedPage`),每翻一页再带一遍就是几十 KB 的重复。"""if offset:return {}source_id, summary = scope- # 题材圆标的有无与取景读题材头像目录,目录版本进键。+ # 题材圆标的有无与取景读题材图目录。图与 `.face.json` 落在 `works/` 子目录+ # (`follow_assets.cache_path`),子目录里新增文件不改上一级的修改时间,所以进键的是它。icon_root = work_icon_root(contract)facets = {} if summary else contract.cached_until_changed(f"follow-facets:{source_id}",- lambda: _follow_facets(store, everything, by_source, alias_map, icon_root, tag_policy),- path_version(icon_root), tables=FOLLOW_GROUP_TABLES)+ lambda: _follow_facets(inputs.store, everything, by_source, inputs.alias_map, icon_root,+ inputs.tag_policy),+ path_version(icon_root / "works"), inputs.revision, tables=FOLLOW_GROUP_TABLES)return {"facets": facets, "author_facets": _author_facets(- contract, store, everything, by_source, alias_map, args, scope, tag_policy)}+ contract, inputs, everything, by_source, args, scope)}-def _page_groups(contract, store, everything, counted, by_author, *, statuses, order, window, summary, cache_key):+def _page_groups(contract, inputs, everything, counted, by_author, *, statuses, order, window, summary, cache_key):"""这一次要回的作品组,以及后面还有没有。管理页的摘要请求不分组。`cache_key` 不为空时整批排好的组按账本版本缓存,翻页、回到列表都不再重新分组;@@ -1776,8 +1811,9 @@ def _page_groups(contract, store, everything, counted, by_author, *, statuses, o# 的几份上传落在相邻两页,页面上就是两张卡。所以整批分组,`limit` 数的是组。def rank():page = tuple(item for item in counted if not statuses or item.status in statuses)- return _sorted_groups(store.group(page, by_author, everything), *order)- ranked = contract.cached_until_changed(cache_key, rank, tables=FOLLOW_GROUP_TABLES) if cache_key else rank()+ return _sorted_groups(inputs.store.group(page, by_author, everything), *order)+ ranked = (contract.cached_until_changed(cache_key, rank, inputs.revision, tables=FOLLOW_GROUP_TABLES)+ if cache_key else rank())offset, limit = windowreturn ranked[offset:offset + limit], len(ranked) > offset + limit@@ -1867,13 +1903,11 @@ def q_follow(contract, args) -> dict:if credential_store.load(provider) is not None)with contract.database.read_connection() as connection:- store = _store(contract, connection)- source_rows = store.sources()- alias_map, author_aliases = store.author_aliases()- tag_policy = OnlineTagPolicy(connection)+ inputs = _follow_inputs(contract, connection)+ source_rows, alias_map, author_aliases, tag_policy = (+ inputs.sources, inputs.alias_map, inputs.author_aliases, inputs.tag_policy)sources = [_source_payload(row, alias_map) for row in source_rows]alias_suggestions = _follow_alias_suggestions(source_rows, alias_map)- enabled_source_ids = {int(row["id"]) for row in source_rows if row["enabled"]}# 作者、来源和标签都不是库里的列:author_key 要经实体绑定、来源 metadata 和# 别名映射推导,tags 要从条目 metadata JSON 解析再去噪。在 SQL 里重写这两套# 推导等于把同一个语义实现两遍,迟早漂移。所以整库取回来在 Python 里筛——@@ -1883,11 +1917,7 @@ def q_follow(contract, args) -> dict:# 全部条目和筛选项只随账本与来源参数变,与筛选、排序、分页无关,按账本版本号# 缓存:一次请求省下解析上万条 metadata 与整库分组的好几秒。- everything = contract.cached_until_changed(- f"follow-items:{source_id}",- lambda: tuple(item for item in store.items(source_id=source_id, limit=_ALL_ITEMS)- if item.source_id in enabled_source_ids and not _excluded_item(item)),- tables=FOLLOW_GROUP_TABLES)+ everything = _enabled_items(contract, inputs, source_id)by_author = group_authors(source_rows, alias_map)# 翻卡与封面计数要知道组里哪几张是同一个画面,判据与缓存见 `follow_faces`。faces = getattr(contract, "follow_faces", None)@@ -1897,17 +1927,17 @@ def q_follow(contract, args) -> dict:_content_hashes(group))if item_id is not None:- return _item_page(_item_groups(contract, store, everything, by_author, source_id).get(item_id),+ return _item_page(_item_groups(contract, inputs, everything, by_author, source_id).get(item_id),payload, sources, author_aliases)counted = _sorted_items(tuple(item for item in everything if _matches(item)), sort, direction, seed)ranked, has_more = _page_groups(- contract, store, everything, counted, by_author, statuses=statuses,+ contract, inputs, everything, counted, by_author, statuses=statuses,order=(sort, direction, seed), window=(offset, limit), summary=summary,cache_key=_ranked_cache_key(args, source_id, statuses, sort, direction))groups = [payload(group) for group in ranked]- facet_args = _page_facets(contract, store, everything, by_source, alias_map, args,- (source_id, summary), tag_policy, offset)+ facet_args = _page_facets(contract, inputs, everything, by_source, args,+ (source_id, summary), offset)# counts 与列表同源,两边都从 `counted` 出发:筛选怎么变,数字就怎么变,# 扣减逻辑也只写一份。写成一句全库 SQL 再逐条减掉被隐藏的 rule34video 和# 无资源的 f95zone 的话,同一套排除规则要维护两份,而且它不看作者、来源和diff --git a/src/peach/web_router.py b/src/peach/web_router.pyindex 34c7d37de..371b2ff48 100644--- a/src/peach/web_router.py+++ b/src/peach/web_router.py@@ -259,7 +259,8 @@ def _get_search_history(contract, args):def _get_taste(contract, args):- return taste_snapshot(contract, str(args.get("window") or "all"))+ return taste_snapshot(contract, str(args.get("window") or "all"),+ retry=str(args.get("retry") or "") == "1")def _get_review(contract, args):diff --git a/src/peach/web_state.py b/src/peach/web_state.pyindex 98ae21a4d..a7e5fcb84 100644--- a/src/peach/web_state.py+++ b/src/peach/web_state.py@@ -66,6 +66,11 @@ FAVICON = ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect wiCACHE_TTL = 90+#: 封面目录时间距今不足这么久算「还在写」,那时扫出的索引只缓存 `COVER_SETTLE_TTL` 秒。+#: 见 `WebContract.cover_index`。+COVER_SETTLE_SECONDS = 2+COVER_SETTLE_TTL = 1.0+def path_version(path: Path) -> int | None:"""文件或目录的修改时间,缓存键拿它认「变了没有」;不存在就是 None。@@ -402,13 +407,20 @@ class WebContract:边车,约一秒。封面与边车的写入方(`cover_artwork.install_cover`、`jav_poster_crop.write_sidecar`)都先写临时文件再换名,新增、替换、删除都会改目录时间。目录不存在时退回 `CACHE_TTL`。++ 目录时间取自文件系统的时钟刻度(NTFS 约 15 ms),`install_cover` 的一连串换名可能+ 落在同一刻度里:读者在两次换名之间扫到的半成品,和换完之后的目录时间相同。所以照+ Git 判「新近修改」的做法,目录时间距今不足 `COVER_SETTLE_SECONDS` 时扫出的结果只按+ 短时效缓存,版本里另记一档,目录静下来之后重扫一次才无限期缓存。"""version = path_version(self.cover_root)if version is None:return self.cached("cover-index", self._scan_cover_root, version=None)with self.cache_lock:self.revision_cache_keys.add("cover-index")- return self.cached("cover-index", self._scan_cover_root, ttl=math.inf, version=version)+ settling = time.time_ns() - version < COVER_SETTLE_SECONDS * 1_000_000_000+ return self.cached("cover-index", self._scan_cover_root,+ ttl=COVER_SETTLE_TTL if settling else math.inf, version=(version, settling))def _scan_cover_root(self) -> dict[str, dict]:"""一次目录扫描同时收集封面存在性和两份 sidecar。目录不存在就是空索引。"""diff --git a/src/peach/web_stats.py b/src/peach/web_stats.pyindex 6d3b8d219..f092f0fc0 100644--- a/src/peach/web_stats.py+++ b/src/peach/web_stats.py@@ -76,8 +76,18 @@ def taste_inputs(contract: WebContract, window: str) -> tuple:TASTE_FRESH_WAIT = 1.0+#: 重算失败后,同一份输入在这段时间内不再重算:失败多半是确定性的(库损坏、代码错误),+#: 页面每两秒一问就每两秒起一趟必然失败的计算。输入变了、或页面点「立即重试」照常重算。+TASTE_RETRY_AFTER = 300.0++#: 口味看板实际读到的账本表,`test_ledger_revision.DeclaredTablesTests` 用 SQLite 授权回调+#: 实测核对。长任务写别的表(关注检查、资料处理的状态与任务心跳)不让看板重算。+TASTE_TABLES = ("asset", "asset_entity", "asset_preference", "entity", "entity_alias",+ "entity_classification", "entity_link", "follow_source")++class _TasteSnapshot:- """一个范围最近算出的看板、它对应的输入版本,以及正在后台重算的那一趟。"""+ """一个范围最近算出的看板、它对应的输入版本、正在后台重算的那一趟,以及最近一次失败。"""def __init__(self):self.version = None@@ -85,6 +95,9 @@ class _TasteSnapshot:self.computed_at: str | None = Noneself.worker: threading.Thread | None = Noneself.error: Exception | None = None+ #: 最近一次失败对应的输入版本与时刻(`time.monotonic()`)。+ self.failed_version = None+ self.failed_at = 0.0_TASTE_SNAPSHOTS: dict[tuple[str, str, str], _TasteSnapshot] = {}@@ -92,12 +105,15 @@ _TASTE_LOCK = threading.Lock()def _taste_version(contract: WebContract, window: str):- """账本版本号加 `taste_inputs`,转成 JSON 再读回,内存与磁盘上的版本才能直接比。"""- revision = contract.ledger_revision()+ """口味依赖表的版本号、代码指纹加 `taste_inputs`,转成 JSON 再读回,内存与磁盘上的+ 版本才能直接比。代码指纹含版本号与口味各模块的源码,升级后落盘的旧快照不算新鲜。"""+ from .taste_preferences import _policy_fingerprint+ revision = contract.ledger_revision(TASTE_TABLES)if revision is None:# 账本还没有版本号时按缓存时效分段,同 `cached_until_changed` 的退路。revision = f"ttl:{int(time.time() // CACHE_TTL)}"- return json.loads(json.dumps([revision, *taste_inputs(contract, window)], default=str))+ return json.loads(json.dumps([revision, _policy_fingerprint(), *taste_inputs(contract, window)],+ default=str))def _taste_snapshot_path(contract: WebContract, window: str):@@ -117,14 +133,15 @@ def _load_taste_snapshot(contract: WebContract, window: str, snapshot: _TasteSnadef _compute_taste_snapshot(contract: WebContract, window: str, version, snapshot: _TasteSnapshot) -> None:try:payload = q_taste(contract, {"window": window})- except Exception as error: # 请求线程会把它原样抛给调用方+ except Exception as error: # 没有旧结果时请求线程原样抛给调用方,有旧结果时随 stale 下发with _TASTE_LOCK:- snapshot.error = error+ snapshot.error, snapshot.failed_version, snapshot.failed_at = (+ error, version, time.monotonic())returncomputed_at = datetime.now(UTC).isoformat()with _TASTE_LOCK:- snapshot.version, snapshot.payload, snapshot.computed_at, snapshot.error = (- version, payload, computed_at, None)+ snapshot.version, snapshot.payload, snapshot.computed_at = version, payload, computed_at+ snapshot.error, snapshot.failed_version = None, Noneif contract.taste_history_store.parent.is_dir():try:atomic_write_text(_taste_snapshot_path(contract, window), json.dumps(@@ -134,12 +151,15 @@ def _compute_taste_snapshot(contract: WebContract, window: str, version, snapshopass-def taste_snapshot(contract: WebContract, window: str) -> dict:+def taste_snapshot(contract: WebContract, window: str, *, retry: bool = False) -> dict:"""`/api/taste`:输入版本没变就回现成的看板,变了就在后台重算。重算在 `TASTE_FRESH_WAIT` 内完成就回新结果;没完成先回上一份,带上 `stale` 与`computed_at`,页面据此标出数据时间并稍后再问。一份都没有时等到算完。同一范围同时只有一趟在算。++ 同一份输入算失败后,`TASTE_RETRY_AFTER` 内不再重算:有旧结果时回旧结果并带 `error`,+ 页面据此停止轮询、给出重试入口;没有旧结果时抛出那次的错误。`retry` 跳过这段等待。"""_taste_since(window)version = _taste_version(contract, window)@@ -149,20 +169,27 @@ def taste_snapshot(contract: WebContract, window: str) -> dict:if snapshot is None:snapshot = _TASTE_SNAPSHOTS[key] = _TasteSnapshot()_load_taste_snapshot(contract, window, snapshot)- if snapshot.version != version and not (snapshot.worker and snapshot.worker.is_alive()):+ if retry:+ snapshot.failed_version = None+ failed = (snapshot.failed_version == version+ and time.monotonic() - snapshot.failed_at < TASTE_RETRY_AFTER)+ waiting = snapshot.version != version and not failed+ if waiting and not (snapshot.worker and snapshot.worker.is_alive()):snapshot.worker = threading.Thread(target=_compute_taste_snapshot, args=(contract, window, version, snapshot),name=f"peach-taste-{window}", daemon=True)snapshot.worker.start()- worker, waiting = snapshot.worker, snapshot.version != version- empty = snapshot.payload is None+ worker, empty = snapshot.worker, snapshot.payload is Noneif waiting:worker.join(None if empty else TASTE_FRESH_WAIT)with _TASTE_LOCK:if snapshot.payload is None:raise snapshot.error or RuntimeError("口味分析未取得")- return {**snapshot.payload, "computed_at": snapshot.computed_at,- "stale": snapshot.version != version}+ stale = snapshot.version != version+ result = {**snapshot.payload, "computed_at": snapshot.computed_at, "stale": stale}+ if stale and snapshot.failed_version == version and snapshot.error is not None:+ result["error"] = str(snapshot.error) or type(snapshot.error).__name__+ return result#: 口味榜里会出圆头像的两排,以及页面上读得到它们的那几个榜单键。标签榜和网站榜@@ -445,9 +472,9 @@ def _replays(c, has_follow: bool) -> list[dict[str, int]]:return [{"k": plays, "n": n} for plays, n in sorted(counts.items())]-#: 统计页账本那一段读到的表。`tag_not_hidden` 读标签偏好,`tag_is_not_a_performer_name` 读实体,-#: 在线播放读关注三张表。-STATS_TABLES = ("asset", "asset_entity", "entity", "asset_tag", "asset_tag_preference",+#: 统计页账本那一段读到的表。`tag_not_hidden` 读标签偏好与标签实体的别名,+#: `tag_is_not_a_performer_name` 读实体,在线播放读关注三张表。+STATS_TABLES = ("asset", "asset_entity", "entity", "entity_alias", "asset_tag", "asset_tag_preference","asset_preference", "follow_playback", "follow_item", "follow_source")diff --git a/tests/test_follow_web.py b/tests/test_follow_web.pyindex 867c64dd2..0719fd787 100644--- a/tests/test_follow_web.py+++ b/tests/test_follow_web.py@@ -5,11 +5,14 @@"""import jsonimport os+import sqlite3import statimport tempfileimport threading+import timeimport unittestimport urllib.parse+from contextlib import closingfrom datetime import datetime, timezonefrom pathlib import Pathfrom types import SimpleNamespace@@ -1608,6 +1611,46 @@ class FollowContractTests(unittest.TestCase):{"axis": "y", "pct": 17,"box": {"cx": 0.5, "cy": 0.2, "faceW": 29, "imgW": 144, "imgH": 256}}]])+ def test_a_work_cover_framed_after_the_first_page_shows_up_on_the_next(self):+ """题材图与取景记录落在 `works/` 子目录里,往里新增文件不改上一级目录的时间;+ 筛选项缓存认的是这一层,取完图下一次请求就带上取景。"""+ self._seed(provider="rule34xxx", ref="typed", candidates=(+ self._typed("1", {"stellar blade": "copyright"},+ preview="https://api-cdn.rule34.xxx/thumbnails/9/s.jpg"),+ ))+ cached = follow_assets.cache_path(+ self.contract.candidate_root / follow_assets.ROOT_NAME, "works", "stellar blade")+ cached.parent.mkdir(parents=True, exist_ok=True)+ # 两级目录都定在一分钟前,下面那次写入必然换一个时间。+ settled = time.time_ns() - 60 * 1_000_000_000+ for directory in (cached.parent, cached.parent.parent):+ os.utime(directory, ns=(settled, settled))+ self.assertIsNone(self._get()["facets"]["works"][0][4])+ avatar_face.write_sidecar(cached, {+ "ratio": 0.563, "px": [144, 256],+ "face": {"cx": 0.5, "cy": 0.2, "w": 0.2, "h": 0.18, "score": 0.9},+ "focus": {"axis": "y", "pct": 17}})+ self.assertEqual(self._get()["facets"]["works"][0][4]["pct"], 17)++ def test_sources_read_before_a_concurrent_write_are_not_kept_under_the_new_version(self):+ """来源、别名先于缓存读出,再被带进缓存的计算。两次读之间来源被停用的话,旧来源+ 算出的条目不能记在新版本下一直命中:停用之后的下一次请求就不再列出它的条目。"""+ self._seed()+ real = FollowStore.sources+ writes = []++ def sources_then_disable(store):+ rows = real(store)+ if not writes:+ with closing(sqlite3.connect(self.db)) as connection, connection:+ writes.append(connection.execute("UPDATE follow_source SET enabled=0").rowcount)+ return rows++ with mock.patch.object(FollowStore, "sources", sources_then_disable):+ self.assertTrue(self._get()["groups"])+ self.assertEqual(writes, [1])+ self.assertEqual(self._get()["groups"], [])+def test_one_series_is_one_pill_however_the_source_spells_each_installment(self):"""一个系列在那一排上只占一枚。diff --git a/tests/test_ledger_revision.py b/tests/test_ledger_revision.pyindex 987426086..48de3155d 100644--- a/tests/test_ledger_revision.py+++ b/tests/test_ledger_revision.py@@ -4,14 +4,23 @@写(CLI 脚本、推送发现的扫描连接、账本同步)大多直接 `sqlite3.connect`,服务看不见,只有库里的触发器看得见,所以这里的写一律走独立连接。"""+import json+import osimport sqlite3import tempfileimport unittestfrom contextlib import closing+from datetime import datetime, timezonefrom pathlib import Pathfrom unittest import mock-from peach import web_state+from peach import taste_history, taste_preferences, web_follow, web_state, web_stats+from peach.follow_sources import FollowCandidate, SourceFetch+from peach.follow_store import FollowStore+from peach.repository import LedgerDatabase+from peach.web_catalog import FACETS_TABLES, GROUP_TABLES, TOPS_TABLES+from peach.web_contract import dispatch_api_get+from peach.web_entity import INDEX_TABLESfrom peach.web_state import WebContractfrom support.ledger import fresh_ledger@@ -127,6 +136,263 @@ class LedgerRevisionTests(unittest.TestCase):self.assertEqual(self.contract.cached_until_changed("catalog", derive, tables=("asset",)), 1)+class _TableReads:+ """装在每条账本连接上的 SQLite authorizer,把读到的表记进所有正在算的声明帧。++ 帧是一次按声明表缓存的计算(或口味、偏好、关注输入这类同样按声明表取版本的读)。+ 嵌套的帧把读表同时计入外层:外层缓存的结果里包含内层的结果,内层依赖的表变了,+ 外层也必须跟着变。+ """++ IGNORED = frozenset({"ledger_revision", "sqlite_master", "sqlite_temp_master", "sqlite_schema"})++ def __init__(self, virtual: set[str]):+ self.virtual = virtual+ self.stack: list[set[str]] = []+ self.frames: list[tuple[str, tuple[str, ...], set[str]]] = []++ def authorize(self, action, table, _column, _database, _trigger):+ if action == sqlite3.SQLITE_READ and table and self.stack:+ # FTS 的影子表算在它的虚表名下。+ table = next((name for name in self.virtual if table.startswith(name + "_")), table)+ if table not in self.IGNORED:+ for reads in self.stack:+ reads.add(table)+ return sqlite3.SQLITE_OK++ def measure(self, label, declared, fn):+ reads: set[str] = set()+ self.stack.append(reads)+ try:+ return fn()+ finally:+ self.stack.pop()+ self.frames.append((str(label), tuple(declared), reads))+++class DeclaredTablesTests(unittest.TestCase):+ """按声明表缓存的计算实际读到的账本表必须是声明的子集。++ 漏声明一张表,那张表变了缓存照样命中,页面就一直是旧的。每条账本连接都装上+ authorizer 并关掉语句缓存(缓存命中的语句不再经过授权回调),每个场景前清空+ 契约与模块级缓存,嵌套缓存的读表才会在外层的计算里出现。+ """++ MOMENT = datetime(2026, 8, 25, 9, 0, tzinfo=timezone.utc)++ def setUp(self):+ self.directory = tempfile.TemporaryDirectory()+ self.addCleanup(self.directory.cleanup)+ self.root = Path(self.directory.name).resolve()+ self.db_path = fresh_ledger(self.root)+ store_root = self.root / "taste-history"+ store_root.mkdir()+ self.contract = WebContract(+ self.db_path, cover_root=self.root / "covers", avatar_root=self.root / "avatars",+ logo_root=self.root / "logos", candidate_root=self.root / "generated",+ follow_sources_root=self.root / "sources", follow_secrets_root=self.root / "secrets",+ follow_shared_root=self.root / "shared", follow_state_root=self.root / "state",+ entry_links_root=self.root / "state", taste_history_store=store_root / "history.sqlite",+ taste_history_import_root=store_root / "imports",+ taste_history_manifest=store_root / "manifest.json")+ self.addCleanup(self.contract.stop_background_jobs)+ self.contract.followups.stop()+ self._seed_ledger()+ self._seed_history(store_root / "history.sqlite")+ with closing(sqlite3.connect(self.db_path)) as connection:+ virtual = {row[0] for row in connection.execute(+ "SELECT name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'")}+ self.reads = _TableReads(virtual)+ real_connect, raw_connect = LedgerDatabase.connect, sqlite3.connect++ def connect(database, *args, **kwargs):+ with mock.patch.object(sqlite3, "connect",+ lambda *a, **k: raw_connect(*a, cached_statements=0, **k)):+ connection = real_connect(database, *args, **kwargs)+ connection.set_authorizer(self.reads.authorize)+ return connection++ real_cached = WebContract.cached_until_changed++ def cached_until_changed(contract, key, fn, *inputs, tables=()):+ return real_cached(contract, key, lambda: self.reads.measure(key, tables, fn),+ *inputs, tables=tables)++ real_inputs = web_follow._follow_inputs++ def follow_inputs(contract, connection):+ return self.reads.measure("follow-inputs", web_follow.FOLLOW_GROUP_TABLES,+ lambda: real_inputs(contract, connection))++ mock.patch.object(LedgerDatabase, "connect", connect).start()+ mock.patch.object(WebContract, "cached_until_changed", cached_until_changed).start()+ mock.patch.object(web_follow, "_follow_inputs", follow_inputs).start()+ self.addCleanup(mock.patch.stopall)++ def _seed_ledger(self):+ with closing(sqlite3.connect(self.db_path)) as connection, connection:+ connection.executemany(+ "INSERT INTO asset(id,location,path,name,medium,size,code,duration,width,height,"+ "play_count,o_count,feedback,snapshot_path,first_seen) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",+ [(1, "local", r"R:\media\ABC-001.mp4", "ABC-001.mp4", "video", 100, "ABC-001", 600,+ 1920, 1080, 2, 1, "like", r"R:\snap\1.jpg", "2026-08-14"),+ (2, "local", r"R:\media\two.mp4", "two.mp4", "video", 200, None, 90,+ 1080, 1920, None, None, None, r"R:\snap\2.jpg", "2026-08-13"),+ (3, "local", r"R:\media\photo.jpg", "photo.jpg", "image", 10, None, None,+ None, None, None, None, None, None, "2026-08-12"),+ (4, "115", r"B:\four.mp4", "four.mp4", "video", 300, "XYZ-002", 1200,+ 1920, 1080, 1, None, "dislike", None, "2026-08-11")])+ connection.executemany(+ "INSERT INTO entity(id,kind,canonical_name,normalized_name,metadata_json,created_at,updated_at) "+ "VALUES(?,?,?,?,?,'2026-01-01','2026-01-01')",+ [(10, "tag", "足交", "足交", "{}"), (11, "performer", "Canonical Alice", "canonical alice", "{}"),+ (12, "creator", "Canonical Creator", "canonical creator", "{}"),+ (13, "studio", "Canonical Studio", "canonical studio", "{}"),+ (14, "series", "Canonical Series", "canonical series", "{}"),+ (15, "agency", "Canonical Agency", "canonical agency", "{}"),+ (16, "tag", "隐藏标签", "隐藏标签", '{"user_tag_hidden": 1}'),+ (17, "performer", "Male Bob", "male bob", '{"gender": "male"}')])+ connection.executemany(+ "INSERT INTO asset_entity(asset_id,entity_id,role,source,confidence) VALUES(?,?,?,?,1.0)",+ [(1, 10, "tag", "test"), (1, 11, "performer", "test"), (1, 12, "creator", "test"),+ (1, 13, "studio", "test"), (1, 14, "series", "test"), (2, 12, "creator", "test"),+ (4, 11, "performer", "test"), (4, 17, "performer", "test"), (4, 13, "studio", "test"),+ (2, 16, "tag", "test")])+ connection.executemany(+ "INSERT INTO asset_tag(asset_id,tag,source) VALUES(?,?,?)",+ [(1, "足交", "name"), (2, "隐藏别名", "name"), (4, "足交", "name")])+ connection.executemany(+ "INSERT INTO entity_alias(entity_id,alias,normalized_alias,source,confidence) VALUES(?,?,?,?,1.0)",+ [(11, "Alice Alias", "alice alias", "test"), (16, "隐藏别名", "隐藏别名", "test")])+ connection.execute(+ "INSERT INTO entity_link(entity_id,link_kind,label,url,hostname,created_at,updated_at) "+ "VALUES(11,'social','OnlyFans','https://onlyfans.com/alice','onlyfans.com','2026-01-01','2026-01-01')")+ connection.execute(+ "INSERT INTO entity_membership(member_id,agency_id,source,confidence,checked_at) "+ "VALUES(11,15,'test',1.0,'2026-01-01')")+ connection.execute(+ "INSERT INTO entity_classification(entity_id,facet,value,source,evidence,status,confidence,checked_at) "+ "VALUES(11,'identity','person','user:test','test','approved',1.0,'2026-01-01')")+ connection.executemany(+ "INSERT INTO asset_preference(profile_id,asset_id,liked,source,updated_at) "+ "VALUES('local-default',?,?,'test','2026-08-20')", [(1, 1), (4, 0)])+ connection.execute(+ "INSERT INTO asset_tag_preference(profile_id,asset_id,normalized_tag,hidden,updated_at) "+ "VALUES('local-default',2,'隐藏别名',1,'2026-08-20')")+ connection.execute(+ "INSERT INTO watch_queue(profile_id,asset_id,added_at,source) "+ "VALUES('local-default',2,'2026-08-20','test')")+ connection.execute(+ "UPDATE profile SET settings_json=? WHERE id='local-default'",+ (json.dumps({"libraryShortcuts": {"favorites": [+ {"entity_id": 11}, {"kind": "tag", "name": "足交"},+ {"kind": "tag", "scope": "online", "tag_id": "animation", "name": "animation"}]}}),))+ with self.contract.database.write_transaction() as connection:+ store = FollowStore(lambda: connection, sources_root=self.contract.follow_sources_root)+ source_id = store.register(provider="rule34video", ref="alice", label="Alice",+ url="https://rule34video.test/alice", semantics="work",+ moment=self.MOMENT)+ store.record(source_id, SourceFetch(+ provider="rule34video", ref="alice", request_url="https://rule34video.test/alice",+ semantics="work", raw_body=b"<html/>", candidates=(+ FollowCandidate(provider="rule34video", external_id="1", title="Fiona - Paizuri",+ url="https://rule34video.com/video/1/x/", duration=20.0,+ media_url="https://example.test/1.mp4",+ thumb_url="https://rule34video.com/t/1.jpg",+ extra={"tags": ["animation", "fiona"],+ "tag_types": {"animation": "general", "fiona": "character"}},+ published_at="2026-08-18T00:00:00Z"),+ FollowCandidate(provider="rule34video", external_id="2", title="Fiona - Paizuri (Nude)",+ url="https://rule34video.com/video/2/x/",+ thumb_url="https://rule34video.com/t/2.jpg"))),+ moment=self.MOMENT)+ items = store.items()+ store.save_asset(items[0].id, confirm=True)+ store.record_playback(items[1].id, moment=self.MOMENT)+ connection.execute(+ "INSERT INTO follow_author_alias(alias_key,alias_name,canonical_key,canonical_name,"+ "source,created_at,updated_at) VALUES('alice2','Alice2','alice','Alice','manual',"+ "'2026-01-01','2026-01-01')")++ @staticmethod+ def _seed_history(path: Path):+ with closing(sqlite3.connect(path)) as store, store:+ taste_history._prepare_store(store)+ store.execute("INSERT INTO history_source VALUES('s','chrome','Default','host','h',"+ "'2026-08-01T00:00:00+00:00','2026-08-20T00:00:00+00:00')")+ store.executemany(+ "INSERT INTO history_visit VALUES('s',?,?,?,?)",+ [("1", "2026-08-10T10:00:00+00:00", "https://onlyfans.com/alice", "Alice"),+ ("2", "2026-08-11T10:00:00+00:00", "https://rule34.xxx/index.php?tags=feet", "Canonical Alice"),+ ("3", "2026-08-12T10:00:00+00:00", "https://example.com/Canonical-Creator", "Canonical Creator")])+ store.execute("INSERT INTO history_bookmark VALUES('s','https://onlyfans.com/alice','Alice',"+ "'2026-08-10T10:00:00+00:00')")++ def _fresh(self):+ """清掉契约与模块级的结果缓存,下一次计算从账本读起。"""+ self.contract.cache.clear()+ self.contract.keyed_cache.clear()+ for cache in (taste_history._HISTORY_ROWS, taste_history._LINKED_SIGNALS,+ taste_history._PREFERENCE_VISITS, taste_preferences._PROFILES):+ cache.clear()++ def _get(self, path, **args):+ self._fresh()+ return dispatch_api_get(self.contract, path, args)++ def test_cached_computations_read_only_their_declared_tables(self):+ for state in ("", "fresh", "played", "flagged", "later"):+ for jav in ("", "1"):+ self._get("/api/tops", state=state, jav=jav, n="4", seed="s")+ self._get("/api/facets", state=state, jav=jav)+ self._get("/api/items", state=state, limit="10")+ for loc in ("online", "local", "115"):+ self._get("/api/facets", loc=loc)+ self._get("/api/items", loc=loc, limit="10")+ self._get("/api/parts", id="1")+ self._get("/api/item", id="1")+ for kind in ("performers", "creators", "studios", "agencies", "tags"):+ self._get("/api/index", kind=kind)+ self._get("/api/stats")+ self._get("/api/folders")+ with closing(sqlite3.connect(self.db_path)) as connection:+ source_id, item_id = (str(connection.execute(f"SELECT min(id) FROM {table}").fetchone()[0])+ for table in ("follow_source", "follow_item"))+ for args in ({}, {"summary": "1"}, {"item": item_id}, {"source": source_id},+ {"author": "Alice"}, {"status": "new", "sort": "old"}, {"offset": "1"}):+ self._get("/api/follow", **args)+ self._fresh()+ web_follow.cover_alternatives(self.contract, int(item_id))+ self._fresh()+ self.reads.measure("taste", web_stats.TASTE_TABLES,+ lambda: web_stats.q_taste(self.contract, {"window": "all"}))+ self._fresh()+ with self.contract.database.read_connection() as connection:+ self.reads.measure("preference-profile", taste_preferences.PROFILE_TABLES,+ lambda: taste_preferences.preference_profile(+ connection, self.contract.taste_history_store, cache=False))++ declarations = {+ "GROUP_TABLES": GROUP_TABLES, "TOPS_TABLES": TOPS_TABLES,+ "FACETS_TABLES": FACETS_TABLES, "INDEX_TABLES": INDEX_TABLES,+ "STATS_TABLES": web_stats.STATS_TABLES,+ "FOLLOW_GROUP_TABLES": web_follow.FOLLOW_GROUP_TABLES,+ "TASTE_TABLES": web_stats.TASTE_TABLES,+ "PROFILE_TABLES": taste_preferences.PROFILE_TABLES}+ names = {tuple(tables): name for name, tables in declarations.items()}+ leaks: dict[str, set[str]] = {}+ for label, declared, reads in self.reads.frames:+ extra = reads - set(declared)+ if declared and extra:+ leaks.setdefault(names.get(declared, label), set()).update(extra)+ self.maxDiff = None+ self.assertEqual({name: sorted(extra) for name, extra in leaks.items()}, {},+ "这些计算读到了没有声明的表")+ exercised = {declared for _, declared, reads in self.reads.frames if reads}+ for name, tables in declarations.items():+ self.assertIn(tuple(tables), exercised, f"{name} 没有被任何场景跑到")++class CoverIndexTests(unittest.TestCase):"""封面索引只认封面目录:账本提交与时间都不让它重扫,换名写入的封面与边车立刻生效。"""@@ -137,6 +403,9 @@ class CoverIndexTests(unittest.TestCase):self.covers = Path(self.directory.name) / "covers"self.covers.mkdir()(self.covers / "ABC-001.jpg").write_bytes(b"jpg")+ # 目录一分钟前就写完了:刚写过的目录只给短时效,见下面的「还在写」用例。+ settled = web_state.time.time_ns() - 60 * 1_000_000_000+ os.utime(self.covers, ns=(settled, settled))self.contract = WebContract(self.db_path, cover_root=self.covers)self.scans = mock.patch.object(self.contract, "_scan_cover_root", wraps=self.contract._scan_cover_root).start()@@ -166,6 +435,30 @@ class CoverIndexTests(unittest.TestCase):(self.covers / "XYZ-002.jpg").unlink()self.assertFalse(self.contract.has_cover("XYZ-002"))+ def test_a_scan_of_a_directory_still_being_written_is_not_kept(self):+ """换名落在同一个时钟刻度里,目录时间不变;刚写过的目录扫出的索引只按短时效缓存,+ 目录静下来之后重扫一次,才无限期缓存。"""+ tick = web_state.time.time_ns()++ def same_tick_install(name):+ (self.covers / name).write_bytes(b"jpg")+ os.utime(self.covers, ns=(tick, tick))++ same_tick_install("XYZ-002.jpg")+ self.assertTrue(self.contract.has_cover("XYZ-002"))+ same_tick_install("XYZ-003.jpg")+ later = web_state.time.monotonic() + web_state.COVER_SETTLE_TTL + 1+ with mock.patch.object(web_state.time, "monotonic", return_value=later):+ self.assertTrue(self.contract.has_cover("XYZ-003"))+ same_tick_install("XYZ-004.jpg")+ settled = tick + (web_state.COVER_SETTLE_SECONDS + 1) * 1_000_000_000+ with mock.patch.object(web_state.time, "time_ns", return_value=settled):+ self.assertTrue(self.contract.has_cover("XYZ-004"))+ scans = self.scans.call_count+ with mock.patch.object(web_state.time, "monotonic", return_value=later + 10 * web_state.CACHE_TTL):+ self.assertTrue(self.contract.has_cover("XYZ-004"))+ self.assertEqual(self.scans.call_count, scans, "目录静下来之后的那一份一直用到目录再变")+if __name__ == "__main__":unittest.main()diff --git a/tests/test_rm_web.py b/tests/test_rm_web.pyindex a1654f221..39ba92562 100644--- a/tests/test_rm_web.py+++ b/tests/test_rm_web.py@@ -895,6 +895,80 @@ class WebDataTests(unittest.TestCase):restarted = get()self.assertEqual((restarted["marker"], restarted["stale"]), ("second", False))+ def _taste_contract(self):+ store_root = Path(self.tmp.name).resolve() / "taste-history"+ store_root.mkdir()+ self.addCleanup(web_stats._TASTE_SNAPSHOTS.clear)+ return rm_web.WebContract(+ Path(self.db_path), avatar_root=self.avatars, logo_root=self.logos,+ taste_history_store=store_root / "history.sqlite",+ taste_history_import_root=store_root / "imports",+ taste_history_manifest=store_root / "manifest.json")++ def test_a_failed_taste_rebuild_backs_off_and_says_so_until_retried(self):+ """重算失败后同一份输入不再每次请求都重算:回上一份并带上失败原因,页面据此停止+ 轮询;点重试或输入再变才重算。一份结果都没有时照旧抛出那次的错误。"""+ contract = self._taste_contract()+ real = web_stats.q_taste++ def get(**args):+ return rm_web.dispatch_api_get(contract, "/api/taste", {"window": "all", **args})++ first = get()+ self.assertNotIn("error", first)+ with contract.write_transaction() as connection:+ connection.execute("UPDATE asset SET play_count=3 WHERE id=1")+ failing = mock.Mock(side_effect=RuntimeError("账本读取失败"))+ with mock.patch.object(web_stats, "q_taste", failing):+ failed = get()+ self.assertEqual((failed["stale"], failed["error"], failed["computed_at"]),+ (True, "账本读取失败", first["computed_at"]))+ self.assertEqual(get()["error"], "账本读取失败")+ self.assertEqual(failing.call_count, 1, "退避期内同一份输入不再重算")+ later = web_stats.time.monotonic() + web_stats.TASTE_RETRY_AFTER + 1+ with mock.patch.object(web_stats.time, "monotonic", return_value=later):+ get()+ self.assertEqual(failing.call_count, 2)+ with mock.patch.object(web_stats, "q_taste", side_effect=real):+ retried = get(retry="1")+ self.assertEqual(retried["stale"], False)+ self.assertNotIn("error", retried)++ web_stats._TASTE_SNAPSHOTS.clear()+ web_stats._taste_snapshot_path(contract, "all").unlink()+ failing = mock.Mock(side_effect=RuntimeError("账本读取失败"))+ with mock.patch.object(web_stats, "q_taste", failing):+ for _ in range(2):+ with self.assertRaisesRegex(RuntimeError, "账本读取失败"):+ get()+ self.assertEqual(failing.call_count, 1)++ def test_a_taste_snapshot_saved_by_older_code_is_rebuilt_after_an_upgrade(self):+ """落盘快照的版本带代码指纹:升级之后、账本还没写过之前,旧代码算的那份不算新鲜。"""+ from peach import taste_preferences+ contract = self._taste_contract()+ real = web_stats.q_taste+ get = lambda: rm_web.dispatch_api_get(contract, "/api/taste", {"window": "all"}) # noqa: E731+ with mock.patch.object(web_stats, "q_taste",+ side_effect=lambda c, a: {**real(c, a), "marker": "old"}):+ self.assertEqual(get()["marker"], "old")+ web_stats._TASTE_SNAPSHOTS.clear()+ with mock.patch.object(taste_preferences, "_policy_fingerprint", return_value="upgraded"), \+ mock.patch.object(web_stats, "q_taste",+ side_effect=lambda c, a: {**real(c, a), "marker": "new"}):+ upgraded = get()+ self.assertEqual((upgraded["marker"], upgraded["stale"]), ("new", False))++ def test_taste_snapshot_ignores_ledger_writes_outside_its_tables(self):+ """看板只认它读的那几张表:关注检查、任务状态这类写入不让它重算。"""+ contract = self._taste_contract()+ get = lambda: rm_web.dispatch_api_get(contract, "/api/taste", {"window": "all"}) # noqa: E731+ get()+ with contract.write_transaction() as connection:+ connection.execute("INSERT INTO search_history(query,last_used_at) VALUES('足交','2026-08-20')")+ with mock.patch.object(web_stats, "q_taste", side_effect=AssertionError("无关写入不该重算")):+ self.assertFalse(get()["stale"])+def test_items_can_skip_repeated_total_count_on_later_pages(self):result = rm_web.q_items(self.contract, {"limit": "1", "offset": "0", "count": "0"},diff --git a/tests/test_taste_history.py b/tests/test_taste_history.pyindex f32c49c0a..553b45b6a 100644--- a/tests/test_taste_history.py+++ b/tests/test_taste_history.py@@ -553,6 +553,51 @@ class TasteHistoryTests(unittest.TestCase):self.assertEqual(visits["Alice Canonical"], 2)self.assertEqual(unrelated["rankings"]["browser_creators"], first["rankings"]["browser_creators"])+ def test_identity_signals_follow_the_rows_they_were_judged_from(self):+ """口味刷新逐个来源提交历史库:读完行之后、判身份之前又写进一批,判出的信号仍记在+ 读出那批行的版本下,下一次用新行算时不会命中旧信号、按位置错配丢掉新访问。"""+ def export(name, url, moment):+ path = self.root / name+ path.write_text(json.dumps([{"url": url, "dt": moment, "metadata": None}]), encoding="utf-8")+ return path++ store = self.root / "sources" / "history.sqlite"+ import_history_exports([export("a.json", "https://onlyfans.com/alice", 1_700_000_000)],+ store, host="test-host")+ original = taste_history._linked_signals+ writes = []++ def commit_then_judge(history_store, cached, ledger_connection):+ if not writes:+ writes.append(import_history_exports(+ [export("b.json", "https://fansly.com/bob", 1_700_000_100)], store, host="test-host"))+ return original(history_store, cached, ledger_connection)++ with closing(sqlite3.connect(self.root / "ledger.db")) as db:+ db.row_factory = sqlite3.Row+ db.executescript(+ "CREATE TABLE asset(id INTEGER PRIMARY KEY,creator TEXT,studio TEXT,play_count INTEGER,"+ "play_seconds REAL,o_count INTEGER,rating INTEGER,feedback TEXT,last_played REAL);"+ "CREATE TABLE asset_preference(profile_id TEXT,asset_id INTEGER,liked INTEGER);"+ "CREATE TABLE entity(id INTEGER PRIMARY KEY,kind TEXT,canonical_name TEXT,normalized_name TEXT);"+ "CREATE TABLE entity_alias(entity_id INTEGER,alias TEXT);"+ "CREATE TABLE asset_entity(asset_id INTEGER,entity_id INTEGER);"+ "INSERT INTO entity VALUES(2,'creator','Alice Canonical','alice canonical');"+ "INSERT INTO entity VALUES(3,'creator','Bob Canonical','bob canonical');"+ "INSERT INTO entity_alias VALUES(2,'alice');"+ "INSERT INTO entity_alias VALUES(3,'bob');")+ with mock.patch.object(taste_history, "_linked_signals", side_effect=commit_then_judge):+ first = build_taste_dashboard(store, db)+ second = build_taste_dashboard(store, db)+ self.assertEqual(len(writes), 1)++ def canonical(dashboard):+ return {row["name"]: row["web_visits"] for row in dashboard["rankings"]["browser_creators"]+ if row["name"].endswith("Canonical")}++ self.assertEqual(canonical(first), {"Alice Canonical": 1})+ self.assertEqual(canonical(second), {"Alice Canonical": 1, "Bob Canonical": 1})+def test_history_is_parsed_once_per_store_version(self):def export(name, url, moment):path = self.root / namediff --git a/web/dist/peach-app.js b/web/dist/peach-app.jsindex 3836f3449..863cc3f3d 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] = "36b981ec-34f8-41e2-8ae5-c5684d06cc05", e._sentryDebugIdIdentifier = "sentry-dbid-36b981ec-34f8-41e2-8ae5-c5684d06cc05");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b970e394-2e1d-436c-9196-d9780f0803a7", e._sentryDebugIdIdentifier = "sentry-dbid-b970e394-2e1d-436c-9196-d9780f0803a7");} 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) => {@@ -73605,7 +73605,7 @@ var gOe = "/api/taste", N3 = "/api/taste/refresh", _Oe = "/api/taste/import", P3["90d", "最近 90 天"],["365d", "最近一年"],["all", "全部时间"]-], bOe = 2e3, xOe = (e) => e?.stale ? bOe : !1, SOe = (e) => e ? new Date(e).toLocaleString("zh-CN", {+], bOe = 2e3, xOe = (e) => e?.stale && !e.error ? bOe : !1, SOe = (e) => e ? new Date(e).toLocaleString("zh-CN", {month: "numeric",day: "numeric",hour: "2-digit",@@ -73613,7 +73613,7 @@ var gOe = "/api/taste", N3 = "/api/taste/refresh", _Oe = "/api/taste/import", P3}) : "—", COe = (e, t) => V(P3, {...e,window: t-}), I3 = (e, t) => B(`${gOe}?window=${e}`, t), wOe = (e) => B(N3, e);+}), I3 = (e, t, n = !1) => B(`${gOe}?window=${e}${n ? "&retry=1" : ""}`, t), wOe = (e) => B(N3, e);async function TOe(e, t) {await H.fetchQuery({queryKey: F3(e),@@ -74576,7 +74576,7 @@ async function y6(e, t) {if (r.status === "rejected") throw r.reason;if (n.status === "rejected") throw n.reason;}-var b6 = v6(() => import("./peach-app.jav-page-BylXQgrV.js")), x6 = v6(() => import("./peach-app.stats-page-Dl0lm7Yt.js")), S6 = v6(() => import("./peach-app.taste-page-C4kidGo2.js")), C6 = v6(() => import("./peach-app.review-page-CPsgIxd6.js")), w6 = v6(() => import("./peach-app.data-cleanup-page-DPCNx1GU.js")), T6 = v6(() => import("./peach-app.duplicates-page-CoHPntSW.js")), E6 = v6(() => import("./peach-app.quality-goals-page-CjcBIXAC.js")), D6 = v6(() => import("./peach-app.scraping-page-DM0a_K9-.js")), O6 = v6(async () => {+var b6 = v6(() => import("./peach-app.jav-page-BylXQgrV.js")), x6 = v6(() => import("./peach-app.stats-page-Dl0lm7Yt.js")), S6 = v6(() => import("./peach-app.taste-page-CidGJvZ7.js")), C6 = v6(() => import("./peach-app.review-page-CPsgIxd6.js")), w6 = v6(() => import("./peach-app.data-cleanup-page-DPCNx1GU.js")), T6 = v6(() => import("./peach-app.duplicates-page-CoHPntSW.js")), E6 = v6(() => import("./peach-app.quality-goals-page-CjcBIXAC.js")), D6 = v6(() => import("./peach-app.scraping-page-DM0a_K9-.js")), O6 = v6(async () => {let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-l4Eg4VIa.js"), import("./peach-app.diagnostics-page-bdA2qUuj.js")]);return {ConfigurationPage: e,@@ -79825,4 +79825,4 @@ JMe($9);//#endregionexport { FI as $2ec61d1d4f780267$export$a8a3e93435678ff9, JI as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, pR as $542a13ca2fa5b484$export$5b6b19405a83ff9d, TT as $72abaeab4d80592f$export$78efe591171d7d45, az as $76d00c5a4edb230a$export$76ccd210b9029917, nz as $76d00c5a4edb230a$export$816b5d811295e6bc, cz as $76d00c5a4edb230a$export$b59bdbef9ce70de2, uz as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, tz as $76d00c5a4edb230a$export$f850895b287ef28e, Sde as $b4f18e3395fe64d7$export$3d96ec278d3efce4, xde as $b4f18e3395fe64d7$export$3e41faf802a29e71, vde as $b4f18e3395fe64d7$export$b2539bed5023c21c, mz as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, Tde as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, fw as $ea3928288112382f$export$439d29a4e110a164, ER as $f2ff30fde7b014be$export$3ddf2d174ce01153, NR as $fe21c36db05242bb$export$a98f0dcb43a68a25, PR as $fe21c36db05242bb$export$d7b12c4107be0d61, sfe as $l, UA as ACCENT_CHOICES, VCe as AMANE_BRIDGE_CHECK_URL, C1 as AMANE_BRIDGE_KEY, HCe as AMANE_BRIDGE_REBUILD_URL, kn as ApiError, IW as ArtSlot, q as Button, cI as ButtonLink, gfe as Bx, Vt as CLOUD_LOCATIONS, k0 as CLOUD_PROXY_HELP, mr as COLUMN_SORT, F1 as CONFIGURATION_KEY, DX as CONFIGURATION_URL, UCe as COOKIE_TEXT_LIMIT, S1 as COVER_JOB_KEY, _i as CREDENTIAL_STATE, v1 as CUSTOM_SOURCES_KEY, _1 as CUSTOM_SOURCES_URL, pV as Checkbox, fV as CheckboxGlyph, rV as ChevronSortDown, VZ as Chip, Y2 as CloudDownloadDialog, YH as CollapseChevron, JH as CollapseRegion, z$ as CollectionSummary, yve as DEFAULT_CATEGORY, Nn as DEFAULT_SORT, l$ as DIAGNOSTICS_KEY, gye as DIRECTORY_TEMPLATE_ERROR, P0 as DISCOVERY_SORTS, U2 as DOWNLOADS_KEY, H2 as DOWNLOADS_URL, ZY as DUPLICATES_KEY, PY as DataTableFooter, AY as DataTableFrame, NY as DataTableSort, rU as Disclosure, REe as DownloadsPanel, Qde as E3, bve as ENTITY_REVIEW_KINDS, ufe as Ea, Dfe as EmptyFocusButton, Kz as EmptyState, tU as ErrorText, ahe as ExternalLink, lr as FEEDS_KEY, FX as FEED_SCHEDULE_KEY, LOe as FLOW_LABEL_X, z3 as FLOW_VIEWBOX, sr as FOLLOW_CHECK_KEY, or as FOLLOW_CREDENTIALS_KEY, P8 as FOLLOW_INITIAL_RANGE_OPTIONS, ar as FOLLOW_MANAGE_KEY, cr as FOLLOW_RESOLVE_KEY, PX as FOLLOW_SCHEDULE_KEY, she as Fact, ohe as FactList, nU as FieldLabel, u1 as Fieldset, l1 as FieldsetTitle, QF as FilterGlass, $F as FilterGlassRows, ZF as FilterIconButton, tI as FilterPill, ihe as Footer, Az as Gg, rI as GlassPill, eU as Help, Lz as HintText, kOe as IDLE_POLL_MS, cve as IDLE_REPAIR, KF as IconButton, Hz as Input, Vz as InputBase, mA as JAV_LAYOUTS, I0 as JAV_RECOMMENDATION_GRID, iZ as JUNK_KEY, Q3 as JavHeader, nve as KEEP_LABELS, dr as LAYOUTS, b0 as LIBRARY_FOLDER_HELP, bH as LIBRARY_PROCESSING_KEY, yX as LINKS_KEY, bX as LINK_CHECK_KEY, Hve as LINK_KINDS, xX as LINK_PRUNE_KEY, wn as LOC, Iz as Label, p1 as LibraryProcessingCard, lB as LibraryShortcuts, jH as LinkButton, UH as LoadingDots, efe as M6, qve as MEDIA_PROCESSING_KEY, LX as MEDIA_PROCESSING_URL, nX as MEDIA_REPAIR_KEY, tX as MEDIA_REPAIR_URL, Vn as MEDIA_SOURCES_KEY, No as MEDIA_SOURCE_ICONS, zt as MEDIA_SOURCE_OPTIONS, sV as MENU_ITEM, cV as MENU_ITEM_INTERACTIVE, oV as MENU_POPOVER_SURFACE, NH as MenuDialog, MG as MixCard, Uz as ModalFrame, Ov as MotionConfigContext, Fz as NR, Gz as Note, Cfe as OA, BX as ORGANIZE_KEY, UX as ORPHAN_RECORDS_KEY, kz as OV, Sz as P7, aCe as PHASES, OX as PICK_FOLDER_URL, h1 as PLAYLISTS_KEY, Uwe as POLICY_COLUMNS, Gwe as POLICY_COVER_NOTE, Wwe as POLICY_MATRIX, y0 as POLICY_SUMMARY, MY as Pagination, f1 as PathLine, lF as PillTabList, GH as Progress, sX as QUALITY_GOALS_KEY, r1 as REPAIR_CARD_TEXT, rX as REPAIR_LIBRARIES_KEY, JX as RESOURCE_APPLY_KEY, qX as RESOURCE_SCAN_KEY, vCe as RESULT_PANEL, yCe as RESULT_SECTION, vve as REVIEW_CATEGORIES, rZ as REVIEW_COUNTS_KEY, uX as REVIEW_KEY, dX as REVIEW_LABELS, FW as RetryNote, Sfe as Rf, nhe as Rows, zCe as SCRAPING_CHECK_URL, b1 as SCRAPING_COVER_URL, x1 as SCRAPING_KEY, RCe as SCRAPING_SETTINGS_URL, jU as SEGMENT, AU as SEGMENTED_TRACK, NX as SETTINGS_KEY, kX as SETTINGS_URL, Pn as SORT_DEFAULT_DIR, Mn as SORT_OPTIONS, Ht as SOURCE_LABELS, u3 as STATS_KEY, QH as Section, rhe as SectionSkeleton, kU as SegmentedRadioGroup, Ghe as SegmentedTabList, gW as Segments, jY as Select, SU as Select$1, z1 as SelectField, CU as SelectItem, Ek as SelectionDock, XH as SettingsCard, the as SettingsRow, ZH as SettingsSectionLabel, dhe as SiteLabel, IU as SortDirectionIcon, yW as SortKeys, KQ as SourceAvatar, sU as SourceLabel, iU as SourceMark, $H as Stack, d1 as StatusLabel, I2 as Switch, _F as TASKS_KEY, vOe as TASTE_REFRESH_KEY, yOe as TASTE_WINDOWS, IX as THUMBNAIL_JOBS_KEY, oZ as TRASH_KEY, Ale as TRIGGER_LABELS, xY as Table, VY as TableColumnControls, HY as TableColumnResizer, WY as TableSelectionHeader, KH as TaskProgress, zz as TextField, Rz as TextFieldContext, Oz as Un, U$ as WANTS_KEY, a4 as WantMagnets, Jf as WithPromise, Cz as Wt, Dz as Xc, Pz as Xf, nfe as Xt, $de as _8, o as __commonJSMin, s as __exportAll, l as __toESM, xfe as aB, Jr as addAlias, qr as addSource, G$ as addWant, B as apiGet, V as apiSend, oA as appSettingsStore, Fye as applyConfirmText, nZ as applyLeftovers, Pye as applyPlanText, Lye as applyText, fA as applyTheme, Zg as asNumber, Cye as attachOrphan, Ar as authorAvatar, Mr as authorGroups, kr as authorInitial, Or as authorName, Yq as autoResetPageIndex, Ra as avatarInner, g3 as bandRows, _ye as baseName, sve as batchOperate, jk as boundedPreference, ive as bulkCloudPreferences, Xz as busyProps, bfe as cB, JEe as cachedMagnetStates, Rf as calcGeneratorVelocity, Eve as canApprove, lf as cancelFrame, Oye as candidateText, HH as cardClass, DA as cardRatio, Ez as cc, pi as checkEvidenceGap, fi as checkFailures, ri as checkFeeds, Kve as checkLine, ui as checkReceipt, di as checkSummary, GCe as checkText, mi as checkedText, iG as clickedBlank, X_e as cloudLocations, Dx as clsx, pfe as cn, Wm as collectMotionValues, kJ as columnVisibilityFeature, gY as column_getCanSort, fY as column_getSortFn, wve as commonReviewSources, _V as configurationSection, COe as configureTasteBrowser, xc as confirmModal, vq as copyInstancePropertiesWithoutMemos, ja as coverUrl, bJ as createColumnHelper, MCe as createPlaylist, vi as credentialDone, Fve as currentReviewRow, oF as cx, Mz as dZ, Mve as decisionPayload, Nve as decisionReceipt, jve as defaultChoice, PCe as deletePlaylist, v0 as diagnosticsSkeleton, pCe as discoveryArtwork, X$ as discoveryKey, nTe as discoveryScore, eve as distinctName, Rve as dropReviewRows, ci as dropSources, yfe as du, ave as duplicateVictims, MF as elapsedText, La as entityFaceImg, tn as entityPath, Cr as errorHeadline, jn as errorMessage, z as esc, qq as expandRowModel, yz as f1, Sr as feedIntervalText, E1 as fetchAmaneBridge, Br as fetchCheckJob, I1 as fetchConfiguration, T1 as fetchCoverJob, zr as fetchCredentials, y1 as fetchCustomSources, u$ as fetchDiagnostics, Z$ as fetchDiscoveries, $Y as fetchDuplicates, Tle as fetchEarlier, Xve as fetchFeedSchedule, ei as fetchFeeds, Rr as fetchFollow, Yve as fetchFollowSchedule, cZ as fetchJunkSummary, wX as fetchLinkCheck, TX as fetchLinkPrune, CX as fetchLinkStats, Jve as fetchMediaProcessing, iX as fetchMediaRepair, Hn as fetchMediaSources, VX as fetchOrganize, lye as fetchOrganizeExample, WX as fetchOrphanRecords, $r as fetchPending, g1 as fetchPlaylists, cX as fetchQualityGoals, aX as fetchRepairLibraries, Vr as fetchResolveJob, XX as fetchResourceApply, YX as fetchResourceScan, gX as fetchReview, sZ as fetchReviewCounts, RX as fetchSettings, w1 as fetchSources, d3 as fetchStats, Hr as fetchSuggestions, yF as fetchTasks, I3 as fetchTaste, wOe as fetchTasteJob, Zve as fetchThumbnailJobs, lZ as fetchTrashSummary, W$ as fetchWants, Sve as filterReviewRows, Sn as firstGrapheme, RK as flexRender, zOe as flowGraph, BOe as flowLabel, RDe as fmtCount, gn as fmtDur, vn as fmtSize, OF as foldRoutine, ai as followFeedByName, ur as followSuggestKey, jF as followupDetail, cf as frame, Ude as g4, MJ as getDefaultPaginationState, EA as gridLayout, jr as groupByAuthor, DF as groupFollowups, pX as groupReviewRows, Mye as hasChanges, ZX as hasResourceRoots, SF as hasResultProblems, AOe as historySpan, bz as i2, OOe as importTasteExport, Af as interpolate, q$ as invalidateWants, AF as isActive, xr as isBroken, hr as isLayout, hh as isMotionValue, fX as isReviewCategory, kF as isRoutine, R0 as javContentSkeleton, yA as javLayout, L0 as javTagSkeleton, Hye as junkBreakdown, FCe as keepPlaylist, ve as keepPreviousData, Fr as keepSelected, f3 as known, qde as l7, EF as latestOfKind, XDe as lengthRows, Gn as localTime, ii as lookupFeedActor, Xde as m7, jz as mM, Jt as mapLimit, Qr as markItem, _3 as max, JDe as mediumRows, Ele as mergeFinished, v3 as min, Bve as mirrorText, dve as missingToolText, eX as mixedCloudPreferences, BF as momentText, Ly as motion, Km as motionValue, yye as organizeOutcome, e2 as overlayHost, gr as pageSizeOf, Pr as pageWindow, Ln as paginationRange, si as patchSource, aH as peachHistory, aH as peachHistory$1, Ave as pendingGenres, BDe as percentText, fye as pickOrganizeFolder, vye as planSummary, p3 as playedFor, HDe as playedItemUrl, vF as pollInterval, ds as popCount, jCe as posterUrl, eG as previewLibraryColor, dye as previewOrganize, mve as previewUrl, TF as problemDestination, NF as progressText, oU as providerIcon, Gve as pruneText, $X as purgeCount, wye as purgeOrphan, Nz as pv, vfe as qE, H as queryClient, xz as r2, IOe as radarRows, GDe as radialArc, KDe as radialBarSize, WDe as radialCeiling, UDe as radialSlices, Kj as randomId, POe as rankDetail, FOe as rankShares, h3 as reachedShare, FF as readableErrorHeadline, rTe as recommendationScore, Ive as recordGenre, Eye as recordsText, ICe as recreatePlaylist, kCe as refreshPlaylists, tl as relayoutCovers, li as reloadFollowManage, zve as reloadReview, qwe as rememberMediaShape, Jwe as rememberSectionHeight, mye as rememberTemplates, j0 as rememberedSectionHeight, Yr as removeAlias, ni as removeFeed, Kr as removeSource, DOe as removeTasteSource, K$ as removeWants, Xr as renameAliasGroup, NCe as renamePlaylist, QDe as replayRows, E as require_jsx_runtime, v as require_react, S as require_react_dom, sq as require_with_selector, cCe as resetWants, In as resolveFollowSort, Wf as resolveStartTime, ACe as resumeAssetId, xve as reviewGroupingOptions, Vye as reviewSummary, Cve as reviewWindow, Ove as rowEvidence, hX as rowFieldName, zJ as rowPaginationFeature, oY as rowSelectionFeature, yY as rowSortingFeature, mX as rowSubject, kve as rowTags, Dve as rowTitle, Wde as s5, Zr as saveCredential, Nye as scanLine, nye as schedulePollInterval, uCe as searchNote, Tve as selectReviewRange, Ir as selectionState, ti as setFeedEnabled, Gr as setSourceEnabled, xV as settingsPath, $_e as sharedNamePrefix, oH as shellNavigate, x8 as showToast, cn as siteMarkUrl, jq as skipFirstRun, sF as sortCx, vr as sortLabel, Ut as sourceDefaultCost, gi as sourceIconUrl, Iye as sourceMeta, ns as spinnerHtml, Df as spring, Jz as spriteGlyph, Ur as startCheck, Uve as startLinkCheck, Wve as startLinkPrune, pye as startOrganize, Wr as startResolve, Aye as startResourceApply, kye as startResourceScan, EOe as startTasteRefresh, Mle as statusLabel, uve as statusLine, br as statusText, OA as storeJavLayout, Pve as submitDecision, HF as summaryItems, xJ as tableFeatures, Mq as tableMemo, Nr as tableRows, CF as taskIssues, L3 as tasteDate, MOe as tasteDimensions, jOe as tasteHours, F3 as tasteKey, xOe as tasteRefetchInterval, SOe as tasteTime, Uu as time, ofe as tl, Lr as toggleGroup, R3 as topScores, lfe as uo, BH as useAction, uQ as useBackgroundJob, tu as useConstant, YF as useHorizontalScroller, nu as useIsomorphicLayoutEffect, nG as useLibraryTints, wt as useMutation, mV as useOverlayScrollbar, Ct as useQuery, A as useQueryClient, ky as useReducedMotion, tye as useRunSchedule, $ve as useSaveFollowSchedule, zX as useSaveSettings, rye as useSaveThumbnailMode, bY as useTable, LY as useTablePreferences, ove as victimBytes, lCe as wantName, VDe as watchNote, m3 as watchedShare, Hs as wireHorizontalScroller, hye as withOrganizeJob };-//# debugId=36b981ec-34f8-41e2-8ae5-c5684d06cc05\ No newline at end of file+//# debugId=b970e394-2e1d-436c-9196-d9780f0803a7\ No newline at end of filediff --git a/web/dist/peach-app.taste-page-C4kidGo2.js b/web/dist/peach-app.taste-page-CidGJvZ7.jssimilarity index 85%rename from web/dist/peach-app.taste-page-C4kidGo2.jsrename to web/dist/peach-app.taste-page-CidGJvZ7.jsindex 81267f483..3321661d4 100644--- a/web/dist/peach-app.taste-page-C4kidGo2.js+++ b/web/dist/peach-app.taste-page-CidGJvZ7.js@@ -1,19 +1,19 @@(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] = "4d97671a-1d34-4ed6-8d3b-f32b7176ba35", e._sentryDebugIdIdentifier = "sentry-dbid-4d97671a-1d34-4ed6-8d3b-f32b7176ba35");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "16976854-2920-4e59-84ef-d4981adcd3de", e._sentryDebugIdIdentifier = "sentry-dbid-16976854-2920-4e59-84ef-d4981adcd3de");} catch {}})();-import { ActivePoints as e, ActivityHeat as t, AnimatedItems as n, BAR_DOMAIN as r, CHART_CARD as i, CHART_COLORS as a, CartesianLabelListContextProvider as o, CategoryTick as s, ChartBackground as c, ChartContainer as l, ChartHead as u, ChartLegend as d, ChartLegendContent as f, ChartTip as p, ChartTooltip as m, ChartTooltipContent as h, DefaultZIndexes as g, Dots as _, EvilBarChart as v, ExpandableRanking as y, LabelListFromLabelProp as b, Layer as x, LoadingIndicator as S, PolarAngleAxis as C, PolarChart as ee, PolarLabelContextProvider as w, PolarLabelFromLabelProp as te, Polygon as ne, RegisterGraphicalItemId as re, SetPolarGraphicalItem as ie, SetPolarLegendPayload as ae, SetTooltipEntrySettings as oe, Text as se, ZIndexLayer as ce, adaptEventsOfChild as le, addRadiusAxis as ue, arrayTooltipSearcher as de, barLabel as fe, categoryAxisWidth as pe, cn as me, createSelector as T, defaultPolarChartProps as he, defaultPolarRadiusAxisProps as ge, fitLabel as _e, getAxisTypeBasedOnLayout as ve, getBandSizeOfAxis as ye, getClassNameFromUnknown as be, getColorsCount as xe, getTooltipNameProp as Se, getValueByDataKey as Ce, identity as we, interpolate as E, isArrayLike as Te, isCategoricalAxis as Ee, isNullish as De, iteratee as Oe, matchAnimationItems as ke, matchByIndex as Ae, noop as je, polarToCartesian as D, removeRadiusAxis as Me, resolveDefaultProps as O, selectAngleAxis as Ne, selectChartDataAndAlwaysIgnoreIndexes as Pe, selectChartLayout as Fe, selectPolarAxisScale as Ie, selectPolarAxisTicks as k, selectPolarViewBox as Le, selectRadiusAxis as Re, selectUnfilteredPolarItems as ze, svgPropertiesAndEvents as Be, svgPropertiesNoEvents as A, svgPropertiesNoEventsFromUnknown as Ve, tone as He, useAnimationCallbacks as Ue, useAnimationStartSnapshot as We, useAppDispatch as Ge, useAppSelector as j, useIsPanorama as Ke, usePolarChartLayout as qe } from "./peach-app.expandable-ranking-CyDn34Ar.js";-import { $542a13ca2fa5b484$export$5b6b19405a83ff9d as Je, $b4f18e3395fe64d7$export$3d96ec278d3efce4 as Ye, $b4f18e3395fe64d7$export$3e41faf802a29e71 as Xe, $b4f18e3395fe64d7$export$b2539bed5023c21c as Ze, Button as M, ButtonLink as Qe, Disclosure as $e, E3 as et, EmptyState as N, FLOW_LABEL_X as tt, FLOW_VIEWBOX as nt, Gg as rt, IDLE_POLL_MS as it, Input as at, M6 as ot, MENU_ITEM as st, MENU_ITEM_INTERACTIVE as ct, MENU_POPOVER_SURFACE as lt, MenuDialog as ut, Note as P, OV as dt, Progress as ft, Rf as pt, SEGMENT as mt, SEGMENTED_TRACK as ht, SegmentedTabList as gt, Select$1 as _t, SelectItem as vt, TASTE_REFRESH_KEY as yt, TASTE_WINDOWS as bt, TaskProgress as xt, Wt as St, Xt as Ct, _8 as wt, __toESM as Tt, aB as Et, avatarInner as Dt, busyProps as F, cB as Ot, cardClass as I, clsx as L, configureTasteBrowser as kt, confirmModal as At, cx as jt, errorMessage as R, f1 as Mt, fetchTaste as Nt, fetchTasteJob as Pt, firstGrapheme as Ft, flowGraph as It, flowLabel as Lt, fmtSize as Rt, g4 as zt, historySpan as Bt, importTasteExport as Vt, keepPreviousData as Ht, mM as Ut, pv as z, queryClient as B, r2 as Wt, radarRows as Gt, rankDetail as Kt, rankShares as qt, removeTasteSource as Jt, require_jsx_runtime as Yt, require_react as Xt, siteMarkUrl as Zt, startTasteRefresh as Qt, tasteDate as $t, tasteDimensions as en, tasteHours as tn, tasteKey as V, tasteRefetchInterval as nn, tasteTime as rn, topScores as an, uo as on, useBackgroundJob as sn, useMutation as cn, useQuery as ln } from "./peach-app.js";+import { ActivePoints as e, ActivityHeat as t, AnimatedItems as n, BAR_DOMAIN as r, CHART_CARD as i, CHART_COLORS as a, CartesianLabelListContextProvider as o, CategoryTick as s, ChartBackground as c, ChartContainer as l, ChartHead as u, ChartLegend as d, ChartLegendContent as f, ChartTip as p, ChartTooltip as m, ChartTooltipContent as h, DefaultZIndexes as g, Dots as _, EvilBarChart as v, ExpandableRanking as y, LabelListFromLabelProp as ee, Layer as b, LoadingIndicator as x, PolarAngleAxis as S, PolarChart as C, PolarLabelContextProvider as te, PolarLabelFromLabelProp as w, Polygon as T, RegisterGraphicalItemId as ne, SetPolarGraphicalItem as re, SetPolarLegendPayload as ie, SetTooltipEntrySettings as ae, Text as E, ZIndexLayer as oe, adaptEventsOfChild as se, addRadiusAxis as ce, arrayTooltipSearcher as le, barLabel as ue, categoryAxisWidth as de, cn as fe, createSelector as D, defaultPolarChartProps as pe, defaultPolarRadiusAxisProps as me, fitLabel as he, getAxisTypeBasedOnLayout as ge, getBandSizeOfAxis as _e, getClassNameFromUnknown as ve, getColorsCount as ye, getTooltipNameProp as be, getValueByDataKey as xe, identity as Se, interpolate as Ce, isArrayLike as we, isCategoricalAxis as Te, isNullish as Ee, iteratee as De, matchAnimationItems as Oe, matchByIndex as ke, noop as Ae, polarToCartesian as O, removeRadiusAxis as je, resolveDefaultProps as Me, selectAngleAxis as Ne, selectChartDataAndAlwaysIgnoreIndexes as Pe, selectChartLayout as Fe, selectPolarAxisScale as Ie, selectPolarAxisTicks as k, selectPolarViewBox as Le, selectRadiusAxis as Re, selectUnfilteredPolarItems as ze, svgPropertiesAndEvents as Be, svgPropertiesNoEvents as A, svgPropertiesNoEventsFromUnknown as Ve, tone as He, useAnimationCallbacks as Ue, useAnimationStartSnapshot as We, useAppDispatch as Ge, useAppSelector as j, useIsPanorama as Ke, usePolarChartLayout as qe } from "./peach-app.expandable-ranking-CyDn34Ar.js";+import { $542a13ca2fa5b484$export$5b6b19405a83ff9d as Je, $b4f18e3395fe64d7$export$3d96ec278d3efce4 as Ye, $b4f18e3395fe64d7$export$3e41faf802a29e71 as Xe, $b4f18e3395fe64d7$export$b2539bed5023c21c as Ze, Button as M, ButtonLink as Qe, Disclosure as $e, E3 as et, EmptyState as tt, FLOW_LABEL_X as nt, FLOW_VIEWBOX as rt, Gg as it, IDLE_POLL_MS as at, Input as ot, M6 as st, MENU_ITEM as ct, MENU_ITEM_INTERACTIVE as lt, MENU_POPOVER_SURFACE as ut, MenuDialog as dt, Note as N, OV as ft, Progress as pt, Rf as mt, SEGMENT as ht, SEGMENTED_TRACK as gt, SegmentedTabList as _t, Select$1 as vt, SelectItem as yt, TASTE_REFRESH_KEY as bt, TASTE_WINDOWS as xt, TaskProgress as St, Wt as Ct, Xt as wt, _8 as Tt, __toESM as Et, aB as Dt, avatarInner as Ot, busyProps as P, cB as kt, cardClass as F, clsx as I, configureTasteBrowser as At, confirmModal as jt, cx as Mt, errorMessage as L, f1 as Nt, fetchTaste as Pt, fetchTasteJob as Ft, firstGrapheme as It, flowGraph as Lt, flowLabel as Rt, fmtSize as zt, g4 as Bt, historySpan as Vt, importTasteExport as Ht, keepPreviousData as Ut, mM as Wt, pv as R, queryClient as z, r2 as Gt, radarRows as Kt, rankDetail as qt, rankShares as Jt, removeTasteSource as Yt, require_jsx_runtime as Xt, require_react as Zt, siteMarkUrl as Qt, startTasteRefresh as $t, tasteDate as en, tasteDimensions as tn, tasteHours as nn, tasteKey as B, tasteRefetchInterval as rn, tasteTime as an, topScores as on, uo as sn, useBackgroundJob as cn, useMutation as V, useQuery as ln } from "./peach-app.js";import { Page as un } from "./peach-app.page-Irl_Wogd.js";import { STAT_STRIP as dn, StatCard as fn, statCardClass as pn } from "./peach-app.stat-card-Q_AB9v0S.js";import { LEGACY_AVATAR_IMG as mn } from "./peach-app.legacy-avatar-CtPLcaNX.js";-var hn = T([(e, t) => k(e, "angleAxis", t, !1)], (e) => {+var hn = D([(e, t) => k(e, "angleAxis", t, !1)], (e) => {if (e) return e.map((e) => e.coordinate);-}), gn = T([(e, t) => k(e, "radiusAxis", t, !1)], (e) => {+}), gn = D([(e, t) => k(e, "radiusAxis", t, !1)], (e) => {if (e) return e.map((e) => e.coordinate);-}), H = /* @__PURE__ */ Tt(Xt()), _n = [+}), H = /* @__PURE__ */ Et(Zt()), _n = ["gridType","radialLines","angleAxisId",@@ -99,7 +99,7 @@ function Cn(e, t) {var wn = (e, t, n, r) => {var i = "";return r.forEach((r, a) => {- var o = D(t, n, e, r);+ var o = O(t, n, e, r);i += a ? `L ${o.x},${o.y}` : `M ${o.x},${o.y}`;}), i += "Z", i;}, Tn = (e) => {@@ -107,7 +107,7 @@ var wn = (e, t, n, r) => {if (!a || !a.length || !o) return null;var s = W({}, A(e));return /*#__PURE__*/ H.createElement("g", { className: "recharts-polar-grid-angle" }, a.map((e) => {- var a = D(t, n, r, e), o = D(t, n, i, e);+ var a = O(t, n, r, e), o = O(t, n, i, e);return /*#__PURE__*/ H.createElement("line", U({ key: `line-${e}` }, s, {x1: a.x,y1: a.y,@@ -118,7 +118,7 @@ var wn = (e, t, n, r) => {}, En = (e) => {var t = e.cx, n = e.cy, r = e.radius, i = W({}, A(e));return /*#__PURE__*/ H.createElement("circle", U({}, i, {- className: L("recharts-polar-grid-concentric-circle", e.className),+ className: I("recharts-polar-grid-concentric-circle", e.className),cx: t,cy: n,r@@ -126,7 +126,7 @@ var wn = (e, t, n, r) => {}, Dn = (e) => {var t = e.radius, n = W({}, A(e));return /*#__PURE__*/ H.createElement("path", U({}, n, {- className: L("recharts-polar-grid-concentric-polygon", e.className),+ className: I("recharts-polar-grid-concentric-polygon", e.className),d: wn(t, e.cx, e.cy, e.polarAngles)}));}, On = (e) => {@@ -153,7 +153,7 @@ var wn = (e, t, n, r) => {strokeWidth: 1,fill: "none"}, An = (e) => {- var t = O(e, kn), n = t.gridType, r = t.radialLines, i = t.angleAxisId, a = t.radiusAxisId, o = t.cx, s = t.cy, c = t.innerRadius, l = t.outerRadius, u = t.polarAngles, d = t.polarRadius, f = t.zIndex, p = vn(t, _n), m = j(Le), h = j((e) => hn(e, i)), g = j((e) => gn(e, a)), _ = Array.isArray(u) ? u : h, v = Array.isArray(d) ? d : g;+ var t = Me(e, kn), n = t.gridType, r = t.radialLines, i = t.angleAxisId, a = t.radiusAxisId, o = t.cx, s = t.cy, c = t.innerRadius, l = t.outerRadius, u = t.polarAngles, d = t.polarRadius, f = t.zIndex, p = vn(t, _n), m = j(Le), h = j((e) => hn(e, i)), g = j((e) => gn(e, a)), _ = Array.isArray(u) ? u : h, v = Array.isArray(d) ? d : g;if (_ == null || v == null) return null;var y = W({cx: m?.cx ?? o ?? 0,@@ -164,7 +164,7 @@ var wn = (e, t, n, r) => {polarRadius: v,zIndex: f}, p);- return y.outerRadius <= 0 ? null : /*#__PURE__*/ H.createElement(ce, { zIndex: y.zIndex }, /*#__PURE__*/ H.createElement("g", { className: "recharts-polar-grid" }, /*#__PURE__*/ H.createElement(On, U({+ return y.outerRadius <= 0 ? null : /*#__PURE__*/ H.createElement(oe, { zIndex: y.zIndex }, /*#__PURE__*/ H.createElement("g", { className: "recharts-polar-grid" }, /*#__PURE__*/ H.createElement(On, U({gridType: n,radialLines: r}, y, {@@ -186,11 +186,11 @@ function jn(e) {}//#endregion//#region node_modules/es-toolkit/dist/compat/math/maxBy.mjs-function Mn(e, t = we) {+function Mn(e, t = Se) {if (e == null) return;let n = jn(e);if (n.length === 0) return;- let r = Oe(t), i, a;+ let r = De(t), i, a;for (let e = 0; e < n.length; e++) {let t = n[e], o = r(t, e, n);o == null || Number.isNaN(o) || typeof o == "symbol" || (a === void 0 || o > a) && (a = o, i = t);@@ -199,11 +199,11 @@ function Mn(e, t = we) {}//#endregion//#region node_modules/es-toolkit/dist/compat/math/minBy.mjs-function Nn(e, t = we) {+function Nn(e, t = Se) {if (e == null) return;let n = jn(e);if (n.length === 0) return;- let r = Oe(t), i, a;+ let r = De(t), i, a;for (let e = 0; e < n.length; e++) {let t = n[e], o = r(t, e, n);o == null || Number.isNaN(o) || typeof o == "symbol" || (a === void 0 || o < a) && (a = o, i = t);@@ -296,16 +296,16 @@ function Hn(e, t) {var Un = "radiusAxis";function Wn(e) {var t = Ge(), n = qe(), r = (0, H.useMemo)(() => {- var t = e.type, r = Vn(e, Pn), i = ve(n, "radiusAxis", t);+ var t = e.type, r = Vn(e, Pn), i = ge(n, "radiusAxis", t);if (i != null) return K(K({}, r), {}, { type: i });}, [e, n]);- return (0, H.useEffect)(() => r == null ? je : (t(ue(r)), () => {- t(Me(r));+ return (0, H.useEffect)(() => r == null ? Ae : (t(ce(r)), () => {+ t(je(r));}), [t, r]), null;}var Gn = (e, t, n, r) => {var i = e.coordinate;- return D(n, r, i, t);+ return O(n, r, i, t);}, Kn = (e) => {var t;switch (e) {@@ -330,14 +330,14 @@ var Gn = (e, t, n, r) => {clockWise: !1};}, Jn = (e, t) => {- var n = e.cx, r = e.cy, i = e.angle, a = e.axisLine, o = Vn(e, Fn), s = t.reduce((e, t) => [Math.min(e[0], t.coordinate), Math.max(e[1], t.coordinate)], [Infinity, -Infinity]), c = D(n, r, s[0], i), l = D(n, r, s[1], i), u = K(K(K({}, A(o)), {}, { fill: "none" }, A(a)), {}, {+ var n = e.cx, r = e.cy, i = e.angle, a = e.axisLine, o = Vn(e, Fn), s = t.reduce((e, t) => [Math.min(e[0], t.coordinate), Math.max(e[1], t.coordinate)], [Infinity, -Infinity]), c = O(n, r, s[0], i), l = O(n, r, s[1], i), u = K(K(K({}, A(o)), {}, { fill: "none" }, A(a)), {}, {x1: c.x,y1: c.y,x2: l.x,y2: l.y});return /*#__PURE__*/ H.createElement("line", G({ className: "recharts-polar-radius-axis-line" }, u));-}, Yn = (e, t, n) => /*#__PURE__*/ H.isValidElement(e) ? /*#__PURE__*/ H.cloneElement(e, t) : typeof e == "function" ? e(t) : /*#__PURE__*/ H.createElement(se, G({}, t, { className: "recharts-polar-radius-axis-tick-value" }), n), Xn = (e, t) => {+}, Yn = (e, t, n) => /*#__PURE__*/ H.isValidElement(e) ? /*#__PURE__*/ H.cloneElement(e, t) : typeof e == "function" ? e(t) : /*#__PURE__*/ H.createElement(E, G({}, t, { className: "recharts-polar-radius-axis-tick-value" }), n), Xn = (e, t) => {var n = e.angle, r = e.tickFormatter, i = e.stroke, a = e.tick, o = Vn(e, In), s = Kn(e.orientation), c = A(o), l = Ve(a), u = t.map((t, o) => {var u = Gn(t, e.angle, e.cx, e.cy), d = K(K(K(K({textAnchor: s,@@ -346,20 +346,20 @@ var Gn = (e, t, n, r) => {stroke: "none",fill: i}, l), {}, { index: o }, u), {}, { payload: t });- return /*#__PURE__*/ H.createElement(x, G({- className: L("recharts-polar-radius-axis-tick", be(a)),+ return /*#__PURE__*/ H.createElement(b, G({+ className: I("recharts-polar-radius-axis-tick", ve(a)),key: `tick-${t.coordinate}`- }, le(e, t, o)), Yn(a, d, r ? r(t.value, o) : t.value));+ }, se(e, t, o)), Yn(a, d, r ? r(t.value, o) : t.value));});- return /*#__PURE__*/ H.createElement(x, { className: "recharts-polar-radius-axis-ticks" }, u);+ return /*#__PURE__*/ H.createElement(b, { className: "recharts-polar-radius-axis-ticks" }, u);}, Zn = (e) => {var t = e.radiusAxisId, n = j(Le), r = j((e) => Ie(e, "radiusAxis", t)), i = j((e) => k(e, "radiusAxis", t, !1));if (n == null || !i || !i.length || r == null) return null;var a = K(K({}, e), {}, { scale: r }, n), o = a.tick, s = a.axisLine;- return /*#__PURE__*/ H.createElement(ce, { zIndex: a.zIndex }, /*#__PURE__*/ H.createElement(x, { className: L("recharts-polar-radius-axis", Un, a.className) }, s && Jn(a, i), o && Xn(a, i), /*#__PURE__*/ H.createElement(w, qn(a.angle, a.cx, a.cy, i), /*#__PURE__*/ H.createElement(te, { label: a.label }), a.children)));+ return /*#__PURE__*/ H.createElement(oe, { zIndex: a.zIndex }, /*#__PURE__*/ H.createElement(b, { className: I("recharts-polar-radius-axis", Un, a.className) }, s && Jn(a, i), o && Xn(a, i), /*#__PURE__*/ H.createElement(te, qn(a.angle, a.cx, a.cy, i), /*#__PURE__*/ H.createElement(w, { label: a.label }), a.children)));};function Qn(e) {- var t = O(e, ge);+ var t = Me(e, me);return /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(Wn, {domain: t.domain,id: t.radiusAxisId,@@ -388,7 +388,7 @@ function $n(e) {//#endregion//#region node_modules/es-toolkit/dist/compat/array/last.mjsfunction er(e) {- if (Te(e) && e.length !== 0) return $n(jn(e));+ if (we(e) && e.length !== 0) return $n(jn(e));}//#endregion//#region node_modules/recharts/es6/state/selectors/radarSelectors.js@@ -435,13 +435,13 @@ function ar(e, t) {}return (t === "string" ? String : Number)(e);}-var or = (e, t) => Ie(e, "radiusAxis", t), sr = T([or], (e) => {+var or = (e, t) => Ie(e, "radiusAxis", t), sr = D([or], (e) => {if (e != null) return { scale: e };-}), cr = T([Re, or], (e, t) => {+}), cr = D([Re, or], (e, t) => {if (e != null && t != null) return nr(nr({}, e), {}, { scale: t });-}), lr = (e, t, n, r) => k(e, "radiusAxis", t, r), ur = (e, t, n) => Ne(e, n), dr = (e, t, n) => Ie(e, "angleAxis", n), fr = T([ur, dr], (e, t) => {+}), lr = (e, t, n, r) => k(e, "radiusAxis", t, r), ur = (e, t, n) => Ne(e, n), dr = (e, t, n) => Ie(e, "angleAxis", n), fr = D([ur, dr], (e, t) => {if (e != null && t != null) return nr(nr({}, e), {}, { scale: t });-}), pr = (e, t, n, r) => k(e, "angleAxis", n, r), mr = T([+}), pr = (e, t, n, r) => k(e, "angleAxis", n, r), mr = D([ur,dr,Le@@ -453,15 +453,15 @@ var or = (e, t) => Ie(e, "radiusAxis", t), sr = T([or], (e) => {cx: n.cx,cy: n.cy};-}), hr = (e, t, n, r, i) => i, gr = T([+}), hr = (e, t, n, r, i) => i, gr = D([Fe,cr,lr,fr,pr-], (e, t, n, r, i) => Ee(e, "radiusAxis") ? ye(t, n, !1) : ye(r, i, !1)), _r = T([ze, hr], (e, t) => {+], (e, t, n, r, i) => Te(e, "radiusAxis") ? _e(t, n, !1) : _e(r, i, !1)), _r = D([ze, hr], (e, t) => {if (e != null) return e.find((e) => e.type === "radar" && t === e.id)?.dataKey;-}), vr = T([+}), vr = D([sr,mr,Pe,@@ -557,20 +557,20 @@ var Dr = (e) => {dataKey: t,type: a,color: Er(r, i),- value: Se(n, t),+ value: be(n, t),payload: e}];}, Or = /*#__PURE__*/ H.memo((e) => {var t = e.dataKey, n = e.stroke, r = e.strokeWidth, i = e.fill, a = e.name, o = e.hide, s = e.tooltipType, c = e.id, l = {dataDefinedOnItem: void 0,- getPosition: je,+ getPosition: Ae,settings: {stroke: n,strokeWidth: r,fill: i,nameKey: void 0,dataKey: t,- name: Se(a, t),+ name: be(a, t),hide: o,type: s,color: Er(n, i),@@ -578,7 +578,7 @@ var Dr = (e) => {graphicalItemId: c}};- return /*#__PURE__*/ H.createElement(oe, { tooltipEntrySettings: l });+ return /*#__PURE__*/ H.createElement(ae, { tooltipEntrySettings: l });});function kr(e) {var t = e.points, n = e.props, r = n.dot, i = n.dataKey;@@ -596,8 +596,8 @@ function kr(e) {function Ar(e) {var t = e.radiusAxis, n = e.angleAxis, r = e.displayedData, i = e.dataKey, a = e.bandSize, o = n.cx, s = n.cy, c = !1, l = [], u = n.type === "number" ? 0 : a ?? 0;r.forEach((e, r) => {- var a = Ce(e, n.dataKey, r), d = Ce(e, i), f = (n.scale.map(a) ?? 0) + u, p = Array.isArray(d) ? er(d) : d, m = De(p) ? 0 : t.scale.map(p) ?? 0;- Array.isArray(d) && d.length >= 2 && (c = !0), l.push(J(J({}, D(o, s, m, f)), {}, {+ var a = xe(e, n.dataKey, r), d = xe(e, i), f = (n.scale.map(a) ?? 0) + u, p = Array.isArray(d) ? er(d) : d, m = Ee(p) ? 0 : t.scale.map(p) ?? 0;+ Array.isArray(d) && d.length >= 2 && (c = !0), l.push(J(J({}, O(o, s, m, f)), {}, {name: a,value: d,cx: o,@@ -610,8 +610,8 @@ function Ar(e) {var d = [];return c && l.forEach((e) => {if (Array.isArray(e.value)) {- var n = e.value[0], r = De(n) ? 0 : t.scale.map(n) ?? 0;- d.push(J(J({}, e), {}, { radius: r }, D(o, s, r, e.angle)));+ var n = e.value[0], r = Ee(n) ? 0 : t.scale.map(n) ?? 0;+ d.push(J(J({}, e), {}, { radius: r }, O(o, s, r, e.angle)));} else d.push(e);}), {points: l,@@ -642,7 +642,7 @@ function jr(e) {function Mr(e) {var t = e.points, n = e.baseLinePoints, r = e.props;if (t == null) return null;- var i = r.shape, a = r.isRange, o = r.connectNulls, s = /*#__PURE__*/ H.isValidElement(i) ? /*#__PURE__*/ H.cloneElement(i, J(J({}, r), {}, { points: t })) : typeof i == "function" ? i(J(J({}, r), {}, { points: t })) : /*#__PURE__*/ H.createElement(ne, q({}, Be(r), {+ var i = r.shape, a = r.isRange, o = r.connectNulls, s = /*#__PURE__*/ H.isValidElement(i) ? /*#__PURE__*/ H.cloneElement(i, J(J({}, r), {}, { points: t })) : typeof i == "function" ? i(J(J({}, r), {}, { points: t })) : /*#__PURE__*/ H.createElement(T, q({}, Be(r), {onMouseEnter: (e) => {var t = r.onMouseEnter;t && t(r, e);@@ -655,21 +655,21 @@ function Mr(e) {baseLinePoints: a ? n : void 0,connectNulls: o}));- return /*#__PURE__*/ H.createElement(x, { className: "recharts-radar-polygon" }, s, /*#__PURE__*/ H.createElement(kr, {+ return /*#__PURE__*/ H.createElement(b, { className: "recharts-radar-polygon" }, s, /*#__PURE__*/ H.createElement(kr, {props: r,points: t}));}var Nr = (e, t) => e == null ? [] : t === 1 ? e.flatMap((e) => e.status === "removed" ? [] : [e.next]) : e.flatMap((e) => e.status === "removed" ? [] : e.status === "matched" ? [J(J({}, e.next), {}, {- x: E(e.prev.x, e.next.x, t),- y: E(e.prev.y, e.next.y, t)+ x: Ce(e.prev.x, e.next.x, t),+ y: Ce(e.prev.y, e.next.y, t)})] : [J(J({}, e.next), {}, {- x: E(e.next.cx, e.next.x, t),- y: E(e.next.cy, e.next.y, t)+ x: Ce(e.next.cx, e.next.x, t),+ y: Ce(e.next.cy, e.next.y, t)})]);function Pr(e) {- var t = e.props, r = e.previousPointsRef, i = e.previousBaseLinePointsRef, a = t.points, o = t.baseLinePoints, s = t.isAnimationActive, c = t.animationBegin, l = t.animationDuration, u = t.animationEasing, d = t.animationMatchBy, f = t.animationInterpolateFn, p = t.onAnimationStart, m = t.onAnimationEnd, h = We(t, i), g = h.startValue, _ = ke(g ?? null, o, d), v = Ue(p, m), y = v.isAnimating, x = v.handleAnimationStart, S = v.handleAnimationEnd, C = qe();- return C == null ? null : /*#__PURE__*/ H.createElement(jr, {+ var t = e.props, r = e.previousPointsRef, i = e.previousBaseLinePointsRef, a = t.points, o = t.baseLinePoints, s = t.isAnimationActive, c = t.animationBegin, l = t.animationDuration, u = t.animationEasing, d = t.animationMatchBy, f = t.animationInterpolateFn, p = t.onAnimationStart, m = t.onAnimationEnd, h = We(t, i), g = h.startValue, _ = Oe(g ?? null, o, d), v = Ue(p, m), y = v.isAnimating, b = v.handleAnimationStart, x = v.handleAnimationEnd, S = qe();+ return S == null ? null : /*#__PURE__*/ H.createElement(jr, {showLabels: !y,points: a}, /*#__PURE__*/ H.createElement(n, {@@ -681,19 +681,19 @@ function Pr(e) {animationBegin: c,animationDuration: l,animationEasing: u,- onAnimationStart: x,- onAnimationEnd: S,+ onAnimationStart: b,+ onAnimationEnd: x,animationInterpolateFn: f,animationMatchBy: d,- layout: C+ layout: S}, (e, n) => {- var r = n === 1 ? o : f(_, n, C);+ var r = n === 1 ? o : f(_, n, S);return h.syncStepValue(r, n), /*#__PURE__*/ H.createElement(Mr, {points: e,baseLinePoints: r,props: t});- }), /*#__PURE__*/ H.createElement(b, { label: t.label }), t.children);+ }), /*#__PURE__*/ H.createElement(ee, { label: t.label }), t.children);}function Fr(e) {var t = (0, H.useRef)(void 0), n = (0, H.useRef)(void 0);@@ -709,7 +709,7 @@ var Ir = {animationBegin: 0,animationDuration: 1500,animationEasing: "ease",- animationMatchBy: Ae,+ animationMatchBy: ke,animationInterpolateFn: Nr,dot: !1,hide: !1,@@ -722,8 +722,8 @@ var Ir = {function Lr(t) {var n = t.hide, r = t.className, i = t.points;if (n) return null;- var a = L("recharts-radar", r);- return /*#__PURE__*/ H.createElement(ce, { zIndex: t.zIndex }, /*#__PURE__*/ H.createElement(x, { className: a }, /*#__PURE__*/ H.createElement(Fr, t)), /*#__PURE__*/ H.createElement(e, {+ var a = I("recharts-radar", r);+ return /*#__PURE__*/ H.createElement(oe, { zIndex: t.zIndex }, /*#__PURE__*/ H.createElement(b, { className: a }, /*#__PURE__*/ H.createElement(Fr, t)), /*#__PURE__*/ H.createElement(e, {points: i,mainColor: Er(t.stroke, t.fill),itemDataKey: t.dataKey,@@ -739,11 +739,11 @@ function Rr(e) {}));}function zr(e) {- var t = O(e, Ir);- return /*#__PURE__*/ H.createElement(re, {+ var t = Me(e, Ir);+ return /*#__PURE__*/ H.createElement(ne, {id: t.id,type: "radar"- }, (e) => /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(ie, {+ }, (e) => /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(re, {type: "radar",id: e,data: void 0,@@ -751,7 +751,7 @@ function zr(e) {hide: t.hide,angleAxisId: t.angleAxisId,radiusAxisId: t.radiusAxisId- }), /*#__PURE__*/ H.createElement(ae, { legendPayload: Dr(t) }), /*#__PURE__*/ H.createElement(Or, {+ }), /*#__PURE__*/ H.createElement(ie, { legendPayload: Dr(t) }), /*#__PURE__*/ H.createElement(Or, {dataKey: t.dataKey,stroke: t.stroke,strokeWidth: t.strokeWidth,@@ -808,21 +808,21 @@ function Wr(e, t) {}return (t === "string" ? String : Number)(e);}-var Gr = ["axis"], Kr = Vr(Vr({}, he), {}, {+var Gr = ["axis"], Kr = Vr(Vr({}, pe), {}, {layout: "centric",startAngle: 90,endAngle: -270}), qr = /*#__PURE__*/ (0, H.forwardRef)((e, t) => {- var n = O(e, Kr);- return /*#__PURE__*/ H.createElement(ee, {+ var n = Me(e, Kr);+ return /*#__PURE__*/ H.createElement(C, {chartName: "RadarChart",defaultTooltipEventType: "axis",validateTooltipEventTypes: Gr,- tooltipPayloadSearcher: de,+ tooltipPayloadSearcher: le,categoricalChartProps: n,ref: t});-}), Y = Yt(), Jr = H.memo(function({ cx: e, cy: t, dataKey: n, chartId: r, className: i, fillOpacity: a = 1, type: o = "default", maskId: s }) {+}), Y = Xt(), Jr = H.memo(function({ cx: e, cy: t, dataKey: n, chartId: r, className: i, fillOpacity: a = 1, type: o = "default", maskId: s }) {let c = H.useId().replace(/:/g, ""), l = `url(#${r}-colors-${String(n)})`;if (e === void 0 || t === void 0) return null;switch (o) {@@ -876,7 +876,7 @@ var Gr = ["axis"], Kr = Vr(Vr({}, he), {}, {}));Yr.displayName = "DefaultDot";var Xr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, Y.jsxs)("g", {- className: me(a, "text-background"),+ className: fe(a, "text-background"),mask: o ? `url(#${o})` : void 0,children: [/* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)("clipPath", {@@ -914,7 +914,7 @@ var Xr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, class}));Xr.displayName = "PrimaryBorderDot";var Zr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, Y.jsxs)("g", {- className: me(a, "text-background"),+ className: fe(a, "text-background"),mask: o ? `url(#${o})` : void 0,children: [/* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)("clipPath", {@@ -970,7 +970,7 @@ function Z({ config: e, data: t, children: n, className: r, chartProps: i, backgchildren: /* @__PURE__ */ (0, Y.jsxs)(l, {className: r,config: e,- children: [/* @__PURE__ */ (0, Y.jsx)(S, { isLoading: u }), /* @__PURE__ */ (0, Y.jsxs)(qr, {+ children: [/* @__PURE__ */ (0, Y.jsx)(x, { isLoading: u }), /* @__PURE__ */ (0, Y.jsxs)(qr, {id: f,data: u ? h : t,...i,@@ -1044,7 +1044,7 @@ function ci({ tick: e = {fontSize: 12}, tickLine: t = !1, ...n }) {let { isLoading: r } = X();- return r ? null : /* @__PURE__ */ (0, Y.jsx)(C, {+ return r ? null : /* @__PURE__ */ (0, Y.jsx)(S, {tick: e,tickLine: t,...n@@ -1130,7 +1130,7 @@ var fi = (e, t, n, r) => {stopOpacity: n?.[i]}, a);}) }), mi = ({ id: e, dataKey: t, config: n }) => {- let r = xe(n[t] ?? {});+ let r = ye(n[t] ?? {});return /* @__PURE__ */ (0, Y.jsx)("linearGradient", {id: `${e}-colors-${t}`,x1: "0",@@ -1143,7 +1143,7 @@ var fi = (e, t, n, r) => {})});}, hi = ({ id: e, dataKey: t, config: n }) => {- let r = xe(n[t] ?? {});+ let r = ye(n[t] ?? {});return /* @__PURE__ */ (0, Y.jsx)("linearGradient", {id: `${e}-radar-stroke-${t}`,x1: "0",@@ -1156,7 +1156,7 @@ var fi = (e, t, n, r) => {})});}, gi = ({ id: e, dataKey: t, config: n }) => {- let r = xe(n[t] ?? {}), i = r === 1 ? [.8, .3] : Array.from({ length: r }, (e, t) => t === 0 ? .8 : .3);+ let r = ye(n[t] ?? {}), i = r === 1 ? [.8, .3] : Array.from({ length: r }, (e, t) => t === 0 ? .8 : .3);return /* @__PURE__ */ (0, Y.jsx)("radialGradient", {id: `${e}-radar-fill-${t}`,cx: "50%",@@ -1226,13 +1226,13 @@ Z.Radar = ii, Z.Dot = ai, Z.ActiveDot = oi, Z.PolarGrid = si, Z.PolarAngleAxis =//#region src/react/taste/charts.tsxfunction xi(e) {let { x: t = 0, cx: n, textAnchor: r, payload: i, ...a } = e, o = String(i?.value ?? ""), s = typeof n == "number" ? n * 2 : 0, c = s ? r === "start" ? s - t : r === "end" ? t : 2 * Math.min(t, s - t) : 56;- return /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("title", { children: o }), /* @__PURE__ */ (0, Y.jsx)(se, {+ return /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("title", { children: o }), /* @__PURE__ */ (0, Y.jsx)(E, {...a,x: t,textAnchor: r,fill: "currentColor",fontSize: 12,- children: _e(o, c - 4)+ children: he(o, c - 4)})] });}var Si = [@@ -1264,7 +1264,7 @@ var Si = ["min-h-64"], Ei = 26, Di = { radius: wi.value }, Oi = (e, t) => Math.sqrt(e / t);function ki({ rows: e, label: t }) {- let n = Gt(e);+ let n = Kt(e);if (!n.length) return null;let r = n[0].value, i = n.map((e) => ({...e,@@ -1296,7 +1296,7 @@ function ki({ rows: e, label: t }) {});}function Ai({ rows: e, label: t }) {- let n = an(e, 8);+ let n = on(e, 8);return n.length ? /* @__PURE__ */ (0, Y.jsx)("section", {"aria-label": t,className: `flex grow flex-col ${Ti[n.length]}`,@@ -1320,7 +1320,7 @@ function Ai({ rows: e, label: t }) {dataKey: "name",interval: 0,tick: /* @__PURE__ */ (0, Y.jsx)(s, { along: "y" }),- width: pe(n.map((e) => e.name))+ width: de(n.map((e) => e.name))}),/* @__PURE__ */ (0, Y.jsx)(v.XAxis, {hide: !0,@@ -1331,7 +1331,7 @@ function Ai({ rows: e, label: t }) {enableHoverHighlight: !0,barProps: {dataKey: "value",- label: fe("right")+ label: ue("right")}}),/* @__PURE__ */ (0, Y.jsx)(p, {})@@ -1340,7 +1340,7 @@ function Ai({ rows: e, label: t }) {}) : null;}function ji({ flows: e }) {- let [t, n] = (0, H.useState)(null), r = It(e);+ let [t, n] = (0, H.useState)(null), r = Lt(e);if (!r) return null;let a = t?.node ?? null, o = (e, n) => t ? a === null ? t.label === n : e.source === a || e.target === a : !0;return /* @__PURE__ */ (0, Y.jsxs)("section", {@@ -1368,7 +1368,7 @@ function ji({ flows: e }) {/* @__PURE__ */ (0, Y.jsx)("div", {className: "min-w-0 max-sm:hidden",children: /* @__PURE__ */ (0, Y.jsxs)("svg", {- viewBox: `0 0 ${nt.width} ${r.height}`,+ viewBox: `0 0 ${rt.width} ${r.height}`,fill: "none",role: "img","aria-label": "来源网站与创作者线索",@@ -1418,13 +1418,13 @@ function ji({ flows: e }) {rx: 5,className: e.side === "source" ? Ci[e.color] : "fill-text-secondary"}), /* @__PURE__ */ (0, Y.jsxs)("text", {- x: tt[e.side],+ x: nt[e.side],y: e.y + e.height / 2,textAnchor: e.side === "source" ? "end" : "start",dominantBaseline: "middle",className: "fill-text-secondary text-caption-1-regular",- children: [Lt(e.name), /* @__PURE__ */ (0, Y.jsx)("tspan", {- x: tt[e.side],+ children: [Rt(e.name), /* @__PURE__ */ (0, Y.jsx)("tspan", {+ x: nt[e.side],dy: 15,children: e.side === "source" ? e.value.toLocaleString() : `${e.share.toFixed(1)}%`})]@@ -1443,14 +1443,14 @@ function ji({ flows: e }) {//#region src/react/taste/browser-sources.tsxvar Mi = "flex min-w-0 items-center gap-3 rounded-xl bg-background-primary-default p-3";function Ni({ browsers: e, sources: t, range: n, children: r }) {- let [i, a] = (0, H.useState)(!1), [o, s] = (0, H.useState)(""), [c, l] = (0, H.useState)(""), u = cn({- mutationFn: (e) => kt(e, n),+ let [i, a] = (0, H.useState)(!1), [o, s] = (0, H.useState)(""), [c, l] = (0, H.useState)(""), u = V({+ mutationFn: (e) => At(e, n),onSuccess: (e) => {- B.setQueryData(V(n), e.dashboard), a(!1), s(""), l("");+ z.setQueryData(B(n), e.dashboard), a(!1), s(""), l("");}});return /* @__PURE__ */ (0, Y.jsxs)("section", {- className: `${I()} flex flex-col gap-4`,+ className: `${F()} flex flex-col gap-4`,"aria-label": "数据源",children: [/* @__PURE__ */ (0, Y.jsxs)("div", {@@ -1465,9 +1465,9 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {children: "添加浏览器"})]}),- u.error ? /* @__PURE__ */ (0, Y.jsx)(P, {+ u.error ? /* @__PURE__ */ (0, Y.jsx)(N, {tone: "error",- children: R(u.error)+ children: L(u.error)}) : null,i ? /* @__PURE__ */ (0, Y.jsxs)("form", {className: "flex flex-col gap-3",@@ -1479,7 +1479,7 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {});},children: [- /* @__PURE__ */ (0, Y.jsx)(at, {+ /* @__PURE__ */ (0, Y.jsx)(ot, {label: "浏览器名称",value: o,onChange: s,@@ -1487,7 +1487,7 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {isRequired: !0,isDisabled: u.isPending}),- /* @__PURE__ */ (0, Y.jsx)(at, {+ /* @__PURE__ */ (0, Y.jsx)(ot, {label: "资料目录或历史文件",value: c,onChange: l,@@ -1509,7 +1509,7 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {type: "submit",variant: "secondary",disabled: !o.trim() || !c.trim(),- ...F(u.isPending),+ ...P(u.isPending),children: "添加"})]})@@ -1561,12 +1561,12 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {children: [/* @__PURE__ */ (0, Y.jsx)(M, {variant: "secondary",size: "small",- ...F(u.isPending),+ ...P(u.isPending),iconOnly: !0,- leadingIcon: e.enabled ? dt : rt,+ leadingIcon: e.enabled ? ft : it,"aria-label": `${e.enabled ? "停止读取" : "启用"} ${e.name}`,onClick: () => {- e.enabled ? At({+ e.enabled ? jt({title: `停止读取 ${e.name}`,body: "已导入的历史与书签仍用于口味分析。",confirmLabel: "停止读取",@@ -1583,11 +1583,11 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {variant: "secondary",size: "small",iconOnly: !0,- leadingIcon: ot,- ...F(u.isPending),+ leadingIcon: st,+ ...P(u.isPending),"aria-label": `删除 ${e.name}`,onClick: () => {- At({+ jt({title: `删除 ${e.name}`,body: "移除该浏览器的读取配置和已导入历史、书签,浏览器原文件保留。可以通过添加浏览器重新接入。",confirmLabel: "删除浏览器来源",@@ -1609,7 +1609,7 @@ function Ni({ browsers: e, sources: t, range: n, children: r }) {}//#endregion//#region src/react/taste/taste-page.tsx-var Pi = 10, Fi = jt(st, ct, "text-body-2-medium"), Q = `${I()} flex flex-col gap-4`, Ii = "rounded-xl bg-background-primary-default p-3", Li = "读取运行 Peach 的这台电脑上的浏览历史与书签", Ri = "导入或读取浏览记录后,这里会列出记录来自哪些设备。", zi = "馆藏中暂时没有与你浏览过的内容相符的标签。", Bi = "读取浏览记录后,这里会按类别汇总你浏览过的内容。", Vi = "这些标签出现在浏览记录中,Peach 的观看或评价记录中尚未出现这些标签", Hi = "采集浏览记录后,这里会列出浏览过的标签。", Ui = "采集浏览记录后,这里会列出浏览过的创作者。", Wi = "采集浏览记录后,这里会列出常访问的网站。", Gi = "在 Peach 里播放或评价作品后,这里会列出对应的标签。", Ki = "在 Peach 里播放或评价作品后,这里会列出对应的创作者。", qi = "在 Peach 里播放或评价作品后,这里会列出对应的女优。", Ji = "在运行 Peach 的电脑上使用浏览器:点上面的「读取浏览器记录」。", Yi = "记录在其他设备上:导出文件后,选择「导入历史文件」或「导入书签文件」。书签支持浏览器导出的 HTML 文件和 Chromium Bookmarks JSON 文件。", Xi = "需要刷新时再次读取或导入;数据源可在页面底部移除。", Zi = "删除这个来源的已导入记录,原始文件保留。若浏览器仍启用,下次读取会再次导入。", Qi = "peach-taste-guide-dismissed", $i = (0, H.createContext)(/* @__PURE__ */ (0, Y.jsx)(Qe, {+var Pi = 10, Fi = Mt(ct, lt, "text-body-2-medium"), Q = `${F()} flex flex-col gap-4`, Ii = "rounded-xl bg-background-primary-default p-3", Li = "读取运行 Peach 的这台电脑上的浏览历史与书签", Ri = "导入或读取浏览记录后,这里会列出记录来自哪些设备。", zi = "馆藏中暂时没有与你浏览过的内容相符的标签。", Bi = "读取浏览记录后,这里会按类别汇总你浏览过的内容。", Vi = "这些标签出现在浏览记录中,Peach 的观看或评价记录中尚未出现这些标签", Hi = "采集浏览记录后,这里会列出浏览过的标签。", Ui = "采集浏览记录后,这里会列出浏览过的创作者。", Wi = "采集浏览记录后,这里会列出常访问的网站。", Gi = "在 Peach 里播放或评价作品后,这里会列出对应的标签。", Ki = "在 Peach 里播放或评价作品后,这里会列出对应的创作者。", qi = "在 Peach 里播放或评价作品后,这里会列出对应的女优。", Ji = "在运行 Peach 的电脑上使用浏览器:点上面的「读取浏览器记录」。", Yi = "记录在其他设备上:导出文件后,选择「导入历史文件」或「导入书签文件」。书签支持浏览器导出的 HTML 文件和 Chromium Bookmarks JSON 文件。", Xi = "需要刷新时再次读取或导入;数据源可在页面底部移除。", Zi = "删除这个来源的已导入记录,原始文件保留。若浏览器仍启用,下次读取会再次导入。", Qi = "peach-taste-guide-dismissed", $i = (0, H.createContext)(/* @__PURE__ */ (0, Y.jsx)(Qe, {size: "small",href: "/",children: "浏览馆藏"@@ -1636,8 +1636,8 @@ function $({ icon: e, term: t, figure: n, detail: r, detailTitle: i, accent: a }function ta({ name: e, domain: t }) {return /* @__PURE__ */ (0, Y.jsxs)("span", {className: "relative inline-grid size-8 shrink-0 place-items-center overflow-hidden rounded-lg bg-background-tertiary-default text-caption-1-medium text-text-secondary",- children: [Ft(e).toUpperCase(), /* @__PURE__ */ (0, Y.jsx)("img", {- src: Zt({ domain: t }),+ children: [It(e).toUpperCase(), /* @__PURE__ */ (0, Y.jsx)("img", {+ src: Qt({ domain: t }),alt: "",loading: "lazy",width: 20,@@ -1654,14 +1654,14 @@ function na({ html: e }) {});}function ra({ rows: e, kind: t, visual: n, empty: r, onSignal: i }) {- if (!e.length) return /* @__PURE__ */ (0, Y.jsx)(N, {+ if (!e.length) return /* @__PURE__ */ (0, Y.jsx)(tt, {size: "compact",- icon: z,+ icon: R,title: "记录还不够",actions: /* @__PURE__ */ (0, Y.jsx)(ea, {}),children: r});- let a = qt(e);+ let a = Jt(e);return /* @__PURE__ */ (0, Y.jsx)(y, {previewCount: Pi,className: "inline-grid w-full gap-x-7 gap-y-2 sm:grid-cols-2",@@ -1690,7 +1690,7 @@ function ra({ rows: e, kind: t, visual: n, empty: r, onSignal: i }) {name: e.name,domain: s}) : null,- n !== "none" && n !== "domain" && (e.entity_id || e.has_avatar || !s) ? /* @__PURE__ */ (0, Y.jsx)(na, { html: Dt(e.name, e.entity_id ? {+ n !== "none" && n !== "domain" && (e.entity_id || e.has_avatar || !s) ? /* @__PURE__ */ (0, Y.jsx)(na, { html: Ot(e.name, e.entity_id ? {id: e.entity_id,has_image: !!e.has_image,image_version: e.image_version,@@ -1704,10 +1704,10 @@ function ra({ rows: e, kind: t, visual: n, empty: r, onSignal: i }) {children: e.name}), /* @__PURE__ */ (0, Y.jsx)("small", {className: "text-caption-1-regular text-text-secondary",- children: Kt(e)+ children: qt(e)})]}),- o ? /* @__PURE__ */ (0, Y.jsx)(Wt, {+ o ? /* @__PURE__ */ (0, Y.jsx)(Gt, {"aria-hidden": !0,className: "size-4 shrink-0 text-text-tertiary"}) : null@@ -1729,15 +1729,15 @@ function ra({ rows: e, kind: t, visual: n, empty: r, onSignal: i }) {}function ia({ label: e, panels: t, onSignal: n }) {return /* @__PURE__ */ (0, Y.jsxs)(Ze, {- className: `${I({ padding: "none" })} flex flex-col`,+ className: `${F({ padding: "none" })} flex flex-col`,children: [/* @__PURE__ */ (0, Y.jsx)("div", {className: "px-4 pt-3",- children: /* @__PURE__ */ (0, Y.jsx)(gt, {+ children: /* @__PURE__ */ (0, Y.jsx)(_t, {"aria-label": e,- className: ht,+ className: gt,children: t.map((e) => /* @__PURE__ */ (0, Y.jsx)(Xe, {id: e.id,- className: mt,+ className: ht,children: e.name}, e.id))})@@ -1820,14 +1820,14 @@ function aa({ data: e, onSignal: t, navigate: n }) {className: "text-caption-1-regular wrap-anywhere text-text-secondary",children: e.detail})]- }), /* @__PURE__ */ (0, Y.jsx)(Wt, {+ }), /* @__PURE__ */ (0, Y.jsx)(Gt, {"aria-hidden": !0,className: "size-4 shrink-0 text-text-tertiary"})]}, e.key))- }) : /* @__PURE__ */ (0, Y.jsx)(N, {+ }) : /* @__PURE__ */ (0, Y.jsx)(tt, {size: "compact",- icon: z,+ icon: R,title: "还没有可探索的入口",actions: /* @__PURE__ */ (0, Y.jsx)(Qe, {size: "small",@@ -1848,7 +1848,7 @@ function oa({ onboarding: e, done: t }) {}});return t || n ? null : /* @__PURE__ */ (0, Y.jsx)("div", {- className: I({+ className: F({padding: "none",className: "p-4"}),@@ -1873,7 +1873,7 @@ function oa({ onboarding: e, done: t }) {target: "_blank",rel: "noopener noreferrer",className: "text-text-primary underline-offset-4 hover:underline",- children: ["Google Takeout", /* @__PURE__ */ (0, Y.jsx)(St, {+ children: ["Google Takeout", /* @__PURE__ */ (0, Y.jsx)(Ct, {"aria-hidden": !0,className: "size-(--icon-inline) shrink-0"})]@@ -1887,7 +1887,7 @@ function oa({ onboarding: e, done: t }) {target: "_blank",rel: "noopener noreferrer",className: "text-text-primary underline-offset-4 hover:underline",- children: ["browserexport", /* @__PURE__ */ (0, Y.jsx)(St, {+ children: ["browserexport", /* @__PURE__ */ (0, Y.jsx)(Ct, {"aria-hidden": !0,className: "size-(--icon-inline) shrink-0"})]@@ -1930,16 +1930,16 @@ function sa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {leadingIcon: et,title: Li,onClick: t,- ...F(e),+ ...P(e),children: "读取浏览器记录"}), /* @__PURE__ */ (0, Y.jsx)(M, {ref: i,iconOnly: !0,- leadingIcon: Mt,+ leadingIcon: Nt,"aria-label": "更多取得浏览记录的方式","aria-haspopup": "dialog","aria-expanded": a,- ...F(e),+ ...P(e),onClick: () => {e || o(!0);}@@ -1950,8 +1950,8 @@ function sa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {onOpenChange: o,placement: "bottom end",offset: 4,- className: lt,- children: /* @__PURE__ */ (0, Y.jsxs)(ut, {+ className: ut,+ children: /* @__PURE__ */ (0, Y.jsxs)(dt, {"aria-label": "更多取得浏览记录的方式",className: "flex w-52 flex-col gap-1 outline-none",children: [@@ -1968,7 +1968,7 @@ function sa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {type: "button",className: Fi,onClick: () => s(n),- children: [/* @__PURE__ */ (0, Y.jsx)(pt, {+ children: [/* @__PURE__ */ (0, Y.jsx)(mt, {"aria-hidden": !0,className: "size-4 shrink-0"}), "导入历史文件"]@@ -1977,7 +1977,7 @@ function sa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {type: "button",className: Fi,onClick: () => s(r),- children: [/* @__PURE__ */ (0, Y.jsx)(zt, {+ children: [/* @__PURE__ */ (0, Y.jsx)(Bt, {"aria-hidden": !0,className: "size-4 shrink-0"}), "导入书签文件"]@@ -1987,10 +1987,10 @@ function sa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {})] });}function ca({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {- let a = cn({- mutationFn: (e) => Jt(e, n),+ let a = V({+ mutationFn: (e) => Yt(e, n),onSuccess: (e) => {- B.setQueryData(V(n), e.dashboard), r("已移除口味数据源");+ z.setQueryData(B(n), e.dashboard), r("已移除口味数据源");}});return /* @__PURE__ */ (0, Y.jsxs)(Ni, {@@ -1999,9 +1999,9 @@ function ca({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {range: n,children: [a.error ? /* @__PURE__ */ (0, Y.jsx)("div", {className: "sm:col-span-2",- children: /* @__PURE__ */ (0, Y.jsx)(P, {+ children: /* @__PURE__ */ (0, Y.jsx)(N, {tone: "error",- children: R(a.error)+ children: L(a.error)})}) : null, e.length ? /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: e.filter((e) => !t.some((t) => t.source_keys?.includes(e.source_key))).map((e) => /* @__PURE__ */ (0, Y.jsxs)("div", {"data-taste-source": "import",@@ -2009,10 +2009,10 @@ function ca({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {children: [/* @__PURE__ */ (0, Y.jsx)("span", {className: "inline-grid size-8 shrink-0 place-items-center rounded-lg text-text-secondary",- children: e.browser === "browserexport" ? /* @__PURE__ */ (0, Y.jsx)(pt, {+ children: e.browser === "browserexport" ? /* @__PURE__ */ (0, Y.jsx)(mt, {"aria-hidden": !0,className: "size-4"- }) : /* @__PURE__ */ (0, Y.jsx)(wt, {+ }) : /* @__PURE__ */ (0, Y.jsx)(Tt, {"aria-hidden": !0,className: "size-4"})@@ -2033,10 +2033,10 @@ function ca({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {"aria-label": `移除 ${e.profile}`,className: "shrink-0",iconOnly: !0,- leadingIcon: ot,- ...F(a.isPending),+ leadingIcon: st,+ ...P(a.isPending),onClick: () => {- a.isPending || At({+ a.isPending || jt({title: "移除口味数据源",body: Zi,confirmLabel: "移除口味数据源",@@ -2045,9 +2045,9 @@ function ca({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {}})]- }, e.source_key)) }) : t.length ? null : /* @__PURE__ */ (0, Y.jsx)(N, {+ }, e.source_key)) }) : t.length ? null : /* @__PURE__ */ (0, Y.jsx)(tt, {size: "compact",- icon: wt,+ icon: Tt,title: "还没有数据源",actions: i,children: Ri@@ -2056,44 +2056,49 @@ function ca({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {}function la(e) {let { onSignal: n, navigate: r, toast: i, onboarding: a } = e, [o, s] = (0, H.useState)("all"), [c, l] = (0, H.useState)("browser"), u = (0, H.useRef)(null), d = (0, H.useRef)(null), f = ln({- queryKey: V(o),- queryFn: ({ signal: e }) => Nt(o, e),- placeholderData: Ht,- refetchInterval: (e) => nn(e.state.data)- }), { job: p, running: m, outcome: h, start: g } = sn({- queryKey: yt,- queryFn: ({ signal: e }) => Pt(e),- start: () => Qt(o),- idlePollMs: it,+ queryKey: B(o),+ queryFn: ({ signal: e }) => Pt(o, e),+ placeholderData: Ut,+ refetchInterval: (e) => rn(e.state.data)+ }), { job: p, running: m, outcome: h, start: g } = cn({+ queryKey: bt,+ queryFn: ({ signal: e }) => Ft(e),+ start: () => $t(o),+ idlePollMs: at,onFinish: (e) => {- e.status !== "failed" && (B.invalidateQueries({ queryKey: ["taste"] }), i(e.warnings?.length ? "部分浏览记录未取得" : "已更新口味分析"));+ e.status !== "failed" && (z.invalidateQueries({ queryKey: ["taste"] }), i(e.warnings?.length ? "部分浏览记录未取得" : "已更新口味分析"));}- }), _ = cn({- mutationFn: (e) => Vt(e),+ }), _ = V({+ mutationFn: (e) => Pt(e, void 0, !0),+ onSuccess: (e, t) => {+ z.setQueryData(B(t), e);+ }+ }), v = V({+ mutationFn: (e) => Ht(e),onSuccess: (e) => {- B.setQueryData(V("all"), e.dashboard), s("all"), i("已导入口味数据");+ z.setQueryData(B("all"), e.dashboard), s("all"), i("已导入口味数据");}- }), v = (e) => {+ }), y = (e) => {let t = e.currentTarget.files?.[0];- e.currentTarget.value = "", t && !_.isPending && (_.reset(), _.mutate(t));- }, y = () => {+ e.currentTarget.value = "", t && !v.isPending && (v.reset(), v.mutate(t));+ }, ee = () => {m || g.isPending || (g.reset(), g.mutate());}, b = f.data;- if (!b) return /* @__PURE__ */ (0, Y.jsx)(un, { children: /* @__PURE__ */ (0, Y.jsx)(P, {+ if (!b) return /* @__PURE__ */ (0, Y.jsx)(un, { children: /* @__PURE__ */ (0, Y.jsx)(N, {tone: "error",title: "口味分析读取失败",- children: f.error ? R(f.error) : "读取口味分析失败"+ children: f.error ? L(f.error) : "读取口味分析失败"}) });- let x = b.summary || {}, S = b.coverage || {}, C = b.rankings || {}, ee = b.storage || {}, w = en(C.browser_categories || []), te = Gt(w).length > 0, ne = b.gaps || [], re = S.tagged || 0, ie = S.identified || 0, ae = g.error ? R(g.error) : _.error ? R(_.error) : h?.status === "failed" ? h.error || "读取未取得" : "", oe = /* @__PURE__ */ (0, Y.jsxs)("div", {+ let x = b.summary || {}, S = b.coverage || {}, C = b.rankings || {}, te = b.storage || {}, w = tn(C.browser_categories || []), T = Kt(w).length > 0, ne = b.gaps || [], re = S.tagged || 0, ie = S.identified || 0, ae = g.error ? L(g.error) : v.error ? L(v.error) : _.error ? L(_.error) : h?.status === "failed" ? h.error || "读取未取得" : "", E = /* @__PURE__ */ (0, Y.jsxs)("div", {className: "flex flex-wrap justify-center gap-2",children: [/* @__PURE__ */ (0, Y.jsx)(M, {variant: "secondary",- ...F(m || g.isPending || _.isPending),- onClick: y,+ ...P(m || g.isPending || v.isPending),+ onClick: ee,children: "读取浏览器记录"}), /* @__PURE__ */ (0, Y.jsx)(M, {variant: "secondary",- ...F(_.isPending),+ ...P(v.isPending),onClick: () => u.current?.click(),children: "导入历史文件"})]@@ -2104,7 +2109,7 @@ function la(e) {variant: "secondary",href: "/",children: "浏览馆藏"- }) : oe : /* @__PURE__ */ (0, Y.jsx)(M, {+ }) : E : /* @__PURE__ */ (0, Y.jsx)(M, {size: "small",variant: "secondary",onClick: () => s("all"),@@ -2118,35 +2123,35 @@ function la(e) {children: [/* @__PURE__ */ (0, Y.jsxs)("div", {className: "flex flex-wrap items-center justify-between gap-3",- children: [/* @__PURE__ */ (0, Y.jsxs)(gt, {+ children: [/* @__PURE__ */ (0, Y.jsxs)(_t, {"aria-label": "口味分析的数据来源",- className: ht,+ className: gt,children: [/* @__PURE__ */ (0, Y.jsx)(Xe, {id: "browser",- className: mt,+ className: ht,children: "浏览器记录"}), /* @__PURE__ */ (0, Y.jsx)(Xe, {id: "peach",- className: mt,+ className: ht,children: "Peach 观看与评价"})]}), /* @__PURE__ */ (0, Y.jsxs)("div", {className: "flex flex-wrap items-center gap-2",children: [- /* @__PURE__ */ (0, Y.jsx)(_t, {+ /* @__PURE__ */ (0, Y.jsx)(vt, {"aria-label": "分析范围",selectedKey: o,onSelectionChange: (e) => {e !== null && s(String(e));},- children: bt.map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(vt, {+ children: xt.map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(yt, {id: e,children: t}, e))}),/* @__PURE__ */ (0, Y.jsx)(sa, {- busy: m || g.isPending || _.isPending,- onRefresh: y,+ busy: m || g.isPending || v.isPending,+ onRefresh: ee,onImport: () => u.current?.click(),onImportBookmarks: () => d.current?.click()}),@@ -2156,7 +2161,7 @@ function la(e) {tabIndex: -1,"aria-hidden": !0,className: "hidden",- onChange: v+ onChange: y}),/* @__PURE__ */ (0, Y.jsx)("input", {ref: d,@@ -2165,7 +2170,7 @@ function la(e) {"aria-hidden": !0,className: "hidden","data-bookmark-import": !0,- onChange: v+ onChange: y})]})]@@ -2178,18 +2183,28 @@ function la(e) {"aria-live": "polite",className: "flex flex-col gap-3 empty:hidden",children: [- m ? /* @__PURE__ */ (0, Y.jsx)(xt, {+ m ? /* @__PURE__ */ (0, Y.jsx)(St, {label: p?.message || "正在读取浏览记录并更新口味分析",value: p?.checked,total: p?.total}) : null,- _.isPending ? /* @__PURE__ */ (0, Y.jsx)(xt, { label: "正在导入口味数据" }) : null,- b.stale ? /* @__PURE__ */ (0, Y.jsx)(xt, { label: `正在更新口味分析,当前显示 ${rn(b.computed_at)} 的结果` }) : null,- ae ? /* @__PURE__ */ (0, Y.jsx)(P, {+ v.isPending ? /* @__PURE__ */ (0, Y.jsx)(St, { label: "正在导入口味数据" }) : null,+ b.stale && b.error ? /* @__PURE__ */ (0, Y.jsx)(N, {+ tone: "error",+ action: /* @__PURE__ */ (0, Y.jsx)(M, {+ variant: "secondary",+ size: "small",+ ...P(_.isPending),+ onClick: () => _.mutate(o),+ children: "立即重试"+ }),+ children: `口味分析更新失败,当前显示 ${an(b.computed_at)} 的结果。${b.error}`+ }) : b.stale ? /* @__PURE__ */ (0, Y.jsx)(St, { label: `正在更新口味分析,当前显示 ${an(b.computed_at)} 的结果` }) : null,+ ae ? /* @__PURE__ */ (0, Y.jsx)(N, {tone: "error",children: ae}) : null,- h?.warnings?.length ? /* @__PURE__ */ (0, Y.jsx)(P, {+ h?.warnings?.length ? /* @__PURE__ */ (0, Y.jsx)(N, {tone: "warning",children: h.warnings.join(";")}) : null@@ -2204,51 +2219,51 @@ function la(e) {children: [/* @__PURE__ */ (0, Y.jsx)($, {accent: 0,- icon: on,+ icon: sn,term: "浏览记录",figure: Number(x.history_visits || 0).toLocaleString(),- detail: Bt(x),- detailTitle: `${$t(x.range_start)}—${$t(x.range_end)}`+ detail: Vt(x),+ detailTitle: `${en(x.range_start)}—${en(x.range_end)}`}),/* @__PURE__ */ (0, Y.jsx)($, {accent: 1,- icon: Ut,+ icon: Wt,term: "口味维度",figure: w.length.toLocaleString(),detail: w[0]?.name || "尚无主维度"}),/* @__PURE__ */ (0, Y.jsx)($, {accent: 2,- icon: z,+ icon: R,term: "浏览线索",figure: ne.length.toLocaleString()}),/* @__PURE__ */ (0, Y.jsx)($, {accent: 3,- icon: zt,+ icon: Bt,term: "浏览器书签",figure: Number(x.bookmarks || 0).toLocaleString(),- detail: `${Number(ee.exports || 0).toLocaleString()} 份私有导出 · ${Rt(ee.bytes || 0)}`+ detail: `${Number(te.exports || 0).toLocaleString()} 份私有导出 · ${zt(te.bytes || 0)}`})]}),/* @__PURE__ */ (0, Y.jsxs)("section", {- className: te ? `${Q} md:flex-row md:gap-6` : Q,+ className: T ? `${Q} md:flex-row md:gap-6` : Q,"aria-label": "浏览器画像",children: [/* @__PURE__ */ (0, Y.jsxs)("div", {- className: te ? "flex shrink-0 flex-col gap-2 pb-5 md:w-80 md:pr-6 md:pb-0" : "flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",+ className: T ? "flex shrink-0 flex-col gap-2 pb-5 md:w-80 md:pr-6 md:pb-0" : "flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children: [/* @__PURE__ */ (0, Y.jsx)("span", {className: "text-caption-1-regular text-text-secondary",children: "浏览器画像"}),- te ? /* @__PURE__ */ (0, Y.jsx)(ki, {+ T ? /* @__PURE__ */ (0, Y.jsx)(ki, {rows: w,label: "主要口味维度"}) : null,/* @__PURE__ */ (0, Y.jsx)("small", {className: "text-caption-1-regular text-text-secondary",- children: b.updated_at ? `更新于 ${$t(b.updated_at)}` : "尚未采集浏览记录"+ children: b.updated_at ? `更新于 ${en(b.updated_at)}` : "尚未采集浏览记录"})]}), /* @__PURE__ */ (0, Y.jsx)("div", {@@ -2256,9 +2271,9 @@ function la(e) {children: w.length ? /* @__PURE__ */ (0, Y.jsx)(Ai, {rows: w,label: "口味维度排名"- }) : /* @__PURE__ */ (0, Y.jsx)(N, {+ }) : /* @__PURE__ */ (0, Y.jsx)(tt, {size: "compact",- icon: z,+ icon: R,title: "暂无口味维度",actions: /* @__PURE__ */ (0, Y.jsx)(ea, {}),children: Bi@@ -2345,26 +2360,26 @@ function la(e) {children: [/* @__PURE__ */ (0, Y.jsx)($, {accent: 0,- icon: Ct,+ icon: wt,term: "Peach 看过",figure: Number(x.peach_items || 0).toLocaleString(),- detail: tn(x.peach_seconds || 0)+ detail: nn(x.peach_seconds || 0)}),/* @__PURE__ */ (0, Y.jsx)($, {accent: 1,- icon: Et,+ icon: Dt,term: "喜欢",figure: Number(x.liked || 0).toLocaleString()}),/* @__PURE__ */ (0, Y.jsx)($, {accent: 2,- icon: Ot,+ icon: kt,term: "不合口味",figure: Number(x.disliked || 0).toLocaleString()}),/* @__PURE__ */ (0, Y.jsx)($, {accent: 3,- icon: Ut,+ icon: Wt,term: "有标签",figure: re.toLocaleString()})@@ -2452,7 +2467,7 @@ function la(e) {browsers: b.browsers || [],window: o,toast: i,- emptyActions: oe+ emptyActions: E})]}) });@@ -2470,7 +2485,7 @@ function ua({ term: e, value: t, rest: n }) {children: `${n.toLocaleString()} 项待补`})]})]- }), /* @__PURE__ */ (0, Y.jsx)(ft, {+ }), /* @__PURE__ */ (0, Y.jsx)(pt, {label: `${e}:${t.toLocaleString()} / ${r.toLocaleString()}`,value: t,max: r@@ -2480,4 +2495,4 @@ function ua({ term: e, value: t, rest: n }) {//#endregionexport { Qi as TASTE_GUIDE_KEY, la as TastePage };-//# debugId=4d97671a-1d34-4ed6-8d3b-f32b7176ba35\ No newline at end of file+//# debugId=16976854-2920-4e59-84ef-d4981adcd3de\ No newline at end of file