Peach: Local-first video metadata scraper and media manager.
fix: align follow browsing and metadata previews
longmeidaod913b87b86ab
diff --git a/docs/reference-snapshots/fiu758-studio-logo-discovery.md b/docs/reference-snapshots/fiu758-studio-logo-discovery.mdnew file mode 100644index 000000000..2cfa800fa--- /dev/null+++ b/docs/reference-snapshots/fiu758-studio-logo-discovery.md@@ -0,0 +1,25 @@+# fiu758 厂牌 Logo 发现证据++- 取得时间:2026-08-27(Asia/Taipei)+- 分类入口:<https://fiu758.com/>+- 复核分类:<https://fiu758.com/?cat=37>(エスワン)+- 页面标题:`エスワン – AV研究所`+- 重复出现的图片资源:<https://fiu758.com/wp-content/uploads/2024/12/yKNs-Ltz_400x400-400x340.jpg>+- 资源实测:WEBP,400×340,SHA-256+ `0a0c2644504f96748591170102ee6560e492288f3df4e98e7d0a398a5317a147`+- 图像内容:白底中央的红色方形 `S1 ONE NO.1 STYLE` 标志。++## 能证明什么++- 首页分类表提供大量厂牌日文原名,可用于发现候选和回查官方来源。+- エスワン分类页确实反复使用一张接近方形的 S1 标志图;长条 Logo 放进头像位前应补成方图。++## 不能证明什么++- fiu758 是第三方博客,不是厂牌官网;分类图、文章封面和广告图不能自动视为官方 Logo。+- 本证据不授权下载整站图片、安装素材或改写 ledger。Logo 仍以官网、维基或品牌自有社交账号为权威来源,fiu758 只作候选发现入口。++## Peach 采用方式++- 立即修正的是已有长条 Logo 的方图归一化:保留原图备份,补背景后原子替换,不改变厂牌身份。+- 后续从本站发现的新 Logo 仍进入 `/review`,保留来源 URL、内容哈希和尺寸,人工确认后才安装。diff --git a/docs/reference-sources.json b/docs/reference-sources.jsonindex 2737c2ec3..a8d17c411 100644--- a/docs/reference-sources.json+++ b/docs/reference-sources.json@@ -35,6 +35,19 @@"web/app.js","tests/test_web_ui.py"]+ },+ {+ "id": "fiu758-studio-logo-discovery",+ "name": "AV研究所厂牌分类与 Logo 发现证据",+ "url": "https://fiu758.com/?cat=37",+ "snapshot": "docs/reference-snapshots/fiu758-studio-logo-discovery.md",+ "checked_on": "2026-08-27",+ "sha256": "d7878183896e238900cc476c5f0c293a2f1b31684dcde0fad42798c1069b7de9",+ "role": "只作厂牌日文分类名和 Logo 候选发现;第三方博客不直接升级为 Peach 真相或已安装素材。",+ "consumers": [+ "scripts/normalize_studio_logos.py",+ "docs/HANDOFF.md"+ ]}]}diff --git a/scripts/normalize_studio_logos.py b/scripts/normalize_studio_logos.pynew file mode 100644index 000000000..550213f65--- /dev/null+++ b/scripts/normalize_studio_logos.py@@ -0,0 +1,131 @@+"""把已经安装的长条厂牌 Logo 补成方图。++候选抓取早已按方图策略处理,但历史安装文件没有回溯。默认只报告;显式+``--apply`` 时必须提供独立备份目录,原图和边车会先备份,再原子替换。+"""+from __future__ import annotations++import argparse+import csv+import hashlib+import json+import os+import shutil+from datetime import datetime, timezone+from pathlib import Path++from peach.config import GENERATED_DIR+from peach.images import MAX_ASPECT, measure_image_size, pad_to_square+++FIELDS = (+ "file", "width", "height", "aspect", "action", "before_sha256",+ "after_sha256", "backup",+)+++def _digest(payload: bytes) -> str:+ return hashlib.sha256(payload).hexdigest()+++def _atomic_bytes(path: Path, payload: bytes) -> None:+ staging = path.with_name(f"{path.name}.tmp")+ staging.write_bytes(payload)+ os.replace(staging, path)+++def _backup_family(source: Path, backup_dir: Path) -> None:+ backup_dir.mkdir(parents=True, exist_ok=True)+ for candidate in (source, Path(f"{source}.ct"), Path(f"{source}.provenance.json")):+ if candidate.is_file():+ shutil.copy2(candidate, backup_dir / candidate.name)+++def normalize(root: Path, *, apply: bool = False,+ backup_dir: Path | None = None) -> list[dict[str, object]]:+ root = root.resolve()+ if apply:+ if backup_dir is None:+ raise ValueError("--apply 必须同时提供 --backup-dir")+ backup_dir = backup_dir.resolve()+ if backup_dir == root or root in backup_dir.parents:+ raise ValueError("备份目录必须在 Logo 目录之外")+ rows: list[dict[str, object]] = []+ for path in sorted(root.glob("*.img")):+ payload = path.read_bytes()+ size = measure_image_size(payload)+ if not size:+ rows.append({"file": path.name, "width": "", "height": "", "aspect": "",+ "action": "invalid", "before_sha256": _digest(payload),+ "after_sha256": "", "backup": ""})+ continue+ width, height = size+ aspect = max(width, height) / min(width, height)+ if aspect <= MAX_ASPECT:+ continue+ squared = pad_to_square(payload)+ if squared is None:+ rows.append({"file": path.name, "width": width, "height": height,+ "aspect": round(aspect, 3), "action": "invalid",+ "before_sha256": _digest(payload), "after_sha256": "", "backup": ""})+ continue+ action = "would-pad"+ backup = ""+ if apply:+ assert backup_dir is not None+ _backup_family(path, backup_dir)+ _atomic_bytes(path, squared)+ _atomic_bytes(Path(f"{path}.ct"), b"image/png")+ evidence = {+ "action": "pad-to-square", "normalized_at": datetime.now(timezone.utc).isoformat(),+ "original_width": width, "original_height": height,+ "original_sha256": _digest(payload), "normalized_sha256": _digest(squared),+ "backup": str(backup_dir / path.name),+ }+ _atomic_bytes(Path(f"{path}.normalization.json"),+ json.dumps(evidence, ensure_ascii=False, indent=2).encode("utf-8"))+ action = "padded"+ backup = str(backup_dir / path.name)+ rows.append({"file": path.name, "width": width, "height": height,+ "aspect": round(aspect, 3), "action": action,+ "before_sha256": _digest(payload), "after_sha256": _digest(squared),+ "backup": backup})+ return rows+++def _write_report(path: Path, rows: list[dict[str, object]]) -> None:+ path.parent.mkdir(parents=True, exist_ok=True)+ staging = path.with_suffix(path.suffix + ".tmp")+ with staging.open("w", encoding="utf-8-sig", newline="") as handle:+ writer = csv.DictWriter(handle, fieldnames=FIELDS)+ writer.writeheader()+ writer.writerows(rows)+ os.replace(staging, path)+++def build_parser() -> argparse.ArgumentParser:+ parser = argparse.ArgumentParser(description="把已安装的长条厂牌 Logo 补成方图")+ parser.add_argument("--root", type=Path, default=GENERATED_DIR / "logos")+ parser.add_argument("--apply", action="store_true")+ parser.add_argument("--backup-dir", type=Path)+ parser.add_argument("--report", type=Path)+ return parser+++def main(argv: list[str] | None = None) -> int:+ args = build_parser().parse_args(argv)+ try:+ rows = normalize(args.root, apply=args.apply, backup_dir=args.backup_dir)+ except (OSError, ValueError) as error:+ print(str(error))+ return 2+ if args.report:+ _write_report(args.report, rows)+ changed = sum(row["action"] in {"would-pad", "padded"} for row in rows)+ print({"mode": "apply" if args.apply else "dry-run", "long_logos": changed,+ "report": str(args.report) if args.report else ""})+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/scrape_codes.py b/scripts/scrape_codes.pyindex b7c1e895c..21f7baa45 100644--- a/scripts/scrape_codes.py+++ b/scripts/scrape_codes.py@@ -69,7 +69,8 @@ CATEGORY_MAP = {"Hidden Camera": "偷拍偷窥", "Amateur": "素人", "Massage": "按摩", "Bath": "浴室","Outdoor": "户外露出", "Car Sex": "车震", "Ass Lover": "美臀", "Butt": "美臀","Glasses": "眼镜", "Virtual Reality": "VR", "POV": "主观视角", "Restraint": "调教",- "Incest": "近亲", "Cheating Wife": "绿帽NTR",+ "Incest": "近亲", "Cheating Wife": "绿帽NTR", "4K": "4K",+ "Digital Mosaic": "有码", "Cowgirl": "骑乘",}diff --git a/src/peach/follow_sources.py b/src/peach/follow_sources.pyindex 9759b0745..17530d75f 100644--- a/src/peach/follow_sources.py+++ b/src/peach/follow_sources.py@@ -461,13 +461,19 @@ class KemonoConnector(_BaseConnector):primary = post.get("file") if isinstance(post.get("file"), dict) else {}attachments = [a for a in (post.get("attachments") or []) if isinstance(a, dict)]media = primary.get("path") or (attachments[0].get("path") if attachments else None)+ # 正片/压缩包仍是主要资源;封面则要从所有附件里另找第一张图片。+ # 过去把两件事绑在同一个 `media` 上,主文件只要是 mp4/zip,后面明明附了+ # jpg 也会显示「没有预览图」。+ preview = next((path for path in (+ primary.get("path"), *(item.get("path") for item in attachments)+ ) if path and str(path).lower().endswith(self._THUMBABLE)), None)return FollowCandidate(provider=self.provider,external_id=post_id or _stable_id(title, str(post.get("published"))),title=title,url=page,media_url=f"https://{self.host}{media}" if media else None,- thumb_url=self._thumb_url(media),+ thumb_url=self._thumb_url(preview),published_at=_iso_from_text(post.get("published")),author=None,summary=_plain_text(post.get("substring")),diff --git a/tests/test_follow_sources.py b/tests/test_follow_sources.pyindex 6ba6e2d51..21488365b 100644--- a/tests/test_follow_sources.py+++ b/tests/test_follow_sources.py@@ -140,6 +140,24 @@ class KemonoConnectorTests(unittest.TestCase):self.assertEqual(result.candidates[0].thumb_url,"https://kemono.cr/thumbnail/data/1c/fa/1cfae7.png")+ def test_archive_video_uses_an_image_attachment_as_its_cover(self):+ """主资源是视频/压缩包时,后附的图片仍然是可用封面。"""+ posts = [{+ "id": "cover-after-video", "title": "Animation pack",+ "published": "2026-08-27T00:00:00Z",+ "file": {"path": "/video/release.mp4"},+ "attachments": [+ {"path": "/video/notes.txt"},+ {"path": "/cover/release.webp"},+ ],+ }]+ result = KemonoConnector(+ transport=_transport(body=json.dumps(posts).encode())).fetch("fanbox/1")+ candidate = result.candidates[0]+ self.assertEqual(candidate.media_url, "https://kemono.cr/video/release.mp4")+ self.assertEqual(candidate.thumb_url,+ "https://kemono.cr/thumbnail/data/cover/release.webp")+def test_no_thumbnail_is_offered_for_things_that_have_none(self):# 视频和压缩包没有缩略图,给了也是 404——那会让卡片显示一张碎图,# 比一个干净的占位更糟。diff --git a/tests/test_follow_web.py b/tests/test_follow_web.pyindex 1556074e9..53d734c8f 100644--- a/tests/test_follow_web.py+++ b/tests/test_follow_web.py@@ -885,9 +885,12 @@ class FollowWebSourceTests(unittest.TestCase):def test_follow_watch_filters_use_the_source_identity(self):self.assertPageContains("if(followAuthor&&source.author_key!==followAuthor)return false;")self.assertPageContains("if(followProvider&&source.provider!==followProvider)return false;")- self.assertPageContains("const chips=(items,current,attr)=>items.length<2?''")- self.assertPageContains("标签 · 只有 ${")+ self.assertPageContains('class="tier followauthors"')+ self.assertPageContains('class="tagbar followfilters"')+ self.assertPageContains('class="pill" data-follow-provider=')+ self.assertPageContains("内容标签目前由 ${")self.assertPageContains(".sort((a,b)=>b[1]-a[1]).slice(0,20)")+ self.assertPageContains(".map(([tag,n])=>[tag,tagLabel(tag),n])")def test_credentials_are_typed_into_the_page_not_into_a_file_by_hand(self):self.assertPageContains('data-cred-form=')@@ -1093,8 +1096,9 @@ class FollowWebSourceTests(unittest.TestCase):self.assertPageContains(selector)def test_the_check_button_stays_visible_on_a_narrow_viewport(self):- # 标签条窄屏横滚会把主操作滚出视野;390 宽下它必须独占一行。- self.assertPageContains(".follow .reviewtabs .fcheck{margin-left:0;flex:1 1 100%")+ # 管理入口不再混进横滚筛选条;390 宽下始终留在标题右侧。+ self.assertPageContains(".followhead{display:flex;align-items:center;justify-content:space-between")+ self.assertPageContains(".followhead{align-items:center}.follow .fcheck{height:36px")if __name__ == "__main__":diff --git a/tests/test_reference_updates.py b/tests/test_reference_updates.pyindex fb0fd6252..04f9f2680 100644--- a/tests/test_reference_updates.py+++ b/tests/test_reference_updates.py@@ -28,7 +28,8 @@ class ReferenceUpdateTests(unittest.TestCase):sources = {source["id"]: source for source in registry["sources"]}self.assertEqual(set(sources),- {"vercel-report-design", "vercel-web-interface-guidelines"},+ {"vercel-report-design", "vercel-web-interface-guidelines",+ "fiu758-studio-logo-discovery"},)self.assertNotEqual(sources["vercel-report-design"]["url"],diff --git a/tests/test_scripts.py b/tests/test_scripts.pyindex 3b9db70a5..4d00195ab 100644--- a/tests/test_scripts.py+++ b/tests/test_scripts.py@@ -42,6 +42,15 @@ class OperationalScriptTests(unittest.TestCase):self.assertIsNone(self.clean_names._logf)self.assertIsNone(self.scrape_codes._logf)+ def test_official_jav_tags_only_enter_the_reviewed_taxonomy(self):+ category_map = self.scrape_codes.CATEGORY_MAP+ self.assertEqual(category_map["Deep Throat"], "深喉")+ self.assertEqual(category_map["4K"], "4K")+ self.assertEqual(category_map["Digital Mosaic"], "有码")+ self.assertEqual(category_map["Cowgirl"], "骑乘")+ self.assertNotIn("Featured Actress", category_map,+ "来源营销分类不是内容标签,不能因为官方给了就直接入库")+def test_test_entrypoint_enforces_worktree_source_and_unittest(self):windows = (ROOT / "scripts" / "test.ps1").read_text(encoding="utf-8")self.assertIn("rev-parse --git-common-dir", windows)@@ -271,6 +280,36 @@ class OperationalScriptTests(unittest.TestCase):self.assertEqual(written[0]["accepted"], "False")self.assertIn("未取得", written[0]["reason"])+ def test_installed_long_studio_logos_are_backed_up_then_squared(self):+ """历史长条图也走方图策略;测试只能写临时目录。"""+ from PIL import Image++ module = load_script("normalize_studio_logos")+ with tempfile.TemporaryDirectory() as tmp:+ root = Path(tmp) / "logos"+ backup = Path(tmp) / "backup"+ root.mkdir()+ wide = root / "wide.img"+ buffer = io.BytesIO()+ Image.new("RGB", (400, 100), "white").save(buffer, "PNG")+ original = buffer.getvalue()+ wide.write_bytes(original)+ Path(f"{wide}.ct").write_text("image/png", encoding="utf-8")++ dry = module.normalize(root)+ self.assertEqual(dry[0]["action"], "would-pad")+ self.assertEqual(wide.read_bytes(), original, "dry-run 不得改图")+ with self.assertRaises(ValueError):+ module.normalize(root, apply=True)++ applied = module.normalize(root, apply=True, backup_dir=backup)+ self.assertEqual(applied[0]["action"], "padded")+ self.assertEqual((backup / "wide.img").read_bytes(), original)+ with Image.open(wide) as squared:+ self.assertEqual(squared.size, (400, 400))+ self.assertEqual(Path(f"{wide}.ct").read_text(encoding="utf-8"), "image/png")+ self.assertTrue(Path(f"{wide}.normalization.json").is_file())+def test_frame_retry_is_reserved_for_bad_color_metadata(self):"""坏色彩元数据才重试。无条件重试会让网盘超时的文件每帧白跑两次 45 秒。"""sheets = self.sheetsdiff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex a9cf1b8d4..863e08c12 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -98,10 +98,18 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains("'follow-manage':'关注管理'")self.assertPageContains("unseen:'没看过','watch-later':'稍后看',flagged:'已标记'")self.assertPageContains('syncPageTitle(path);')+ self.assertPageContains('queueMicrotask(()=>{syncHeaderActions();paintListTitle()})')self.assertPageContains("queueMicrotask(()=>$('#settingsClose').focus())")self.assertPageContains('if(settingsReturnFocus&&document.contains(settingsReturnFocus))')self.assertPageContains("if(e.key!=='Tab')return")+ def test_catalog_state_title_never_leaks_into_other_routes(self):+ self.assertPageContains("!manageSection()&&isCatalogPath(path)?STATE_LABELS[state.state]||'':''")++ def test_reviewed_tag_labels_do_not_add_machine_translated_suffixes(self):+ self.assertPageLacks("'深喉':'深喉咙'")+ self.assertPageContains('const tagLabel=tag=>TAG_DISPLAY_NAMES[tag]||tag;')+def test_entity_routes_are_semantic_and_not_model_shaped(self):self.assertPageLacks("route(`/entity/")self.assertPageContains("performer:'performers'")diff --git a/web/app.css b/web/app.cssindex 3c19c06a7..553886956 100644--- a/web/app.css+++ b/web/app.css@@ -185,7 +185,7 @@ button,a,input,textarea,select,summary{touch-action:manipulation}.combo .clr{background:none;border:0;color:var(--muted);cursor:pointer;font-size:var(--fs-xs);text-decoration:underline}/* 统计页 */.stats{padding:8px 0 42px}-.playlistpage{padding:8px 0 42px}.playlistpage>header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:20px}.playlistpage h2{margin:0 0 5px}.playlistpage p{margin:0;color:var(--muted);font-size:var(--fs-sm)}+.playlistpage{padding:4px 0 42px}.playlistpage>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:20px}.playlistpage h2{margin:0 0 5px}.playlistpage p{margin:0;color:var(--muted);font-size:var(--fs-sm)}.playlistcreate{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}.playlistcreate label{display:grid;gap:5px;color:var(--muted);font-size:var(--fs-xs)}.playlistcreate input,.playlistmeta input{min-width:220px;border:1px solid var(--border-15);border-radius:8px;background:var(--surface);color:var(--ink);padding:9px 11px;font:inherit}.playlistcreate button,.playlistactions button{border:1px solid var(--border-15);border-radius:8px;background:transparent;color:var(--ink-2);padding:9px 12px;cursor:pointer}.playlistcreate button:hover,.playlistactions button:hover{border-color:var(--tungsten);color:var(--ink)}.playlistcreate [data-playlist-state]{flex-basis:100%;color:var(--drop);font-size:var(--fs-xs)}.playlistcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}.playlistcard{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:12px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface);min-width:0}.playlistcover{position:relative;aspect-ratio:16/10;border:0;border-radius:8px;background:#000;overflow:hidden;padding:0;cursor:pointer}.playlistcover:disabled{cursor:default}.playlistcover img{width:100%;height:100%;object-fit:cover}.playlistcover span{position:absolute;right:5px;bottom:5px;border-radius:5px;background:#000b;color:#fff;padding:3px 6px;font-size:var(--fs-xs)}.playlistmeta{display:grid;align-content:center;gap:6px;min-width:0}.playlistmeta input{min-width:0;width:100%;font-weight:600}.playlistmeta small{color:var(--muted)}.playlistactions{grid-column:1/-1;display:flex;gap:7px;justify-content:flex-end}.playlistactions .danger{color:var(--drop)}.playlistdialog{width:min(520px,calc(100vw - 28px));border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);padding:0;box-shadow:0 24px 80px #000b}.playlistdialog::backdrop{background:#000a;backdrop-filter:blur(5px)}.playlistdialoghead{display:flex;align-items:center;justify-content:space-between;padding:16px 17px;border-bottom:1px solid var(--line-soft)}.playlistdialoghead h2{margin:0;font-size:var(--fs-xl)}.playlistdialoghead button{width:34px;height:34px;border:0;border-radius:50%;background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}.playlistdialoghead button:hover{background:var(--hover)}.playlistdialoghead svg{width:19px;height:19px;stroke:currentColor;fill:none}.playlistdialogbody{padding:17px}.playlistpicklist{display:grid;gap:7px;margin-top:16px;max-height:320px;overflow-y:auto}.playlistpickrow{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--border-10);border-radius:9px;background:var(--overlay-5);color:var(--ink);padding:11px 12px;text-align:left;cursor:pointer}.playlistpickrow:hover{border-color:var(--tungsten)}.playlistpickrow small{color:var(--muted)}@@ -1179,9 +1179,24 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位.gate.offline .chip{cursor:pointer;margin-top:4px}/* ── 在线追更 ── */-.follow{padding:8px 0 42px}-.follow .reviewtabs .fcheck{margin-left:auto;display:inline-flex;align-items:center;gap:6px;background:var(--tungsten);border-color:var(--tungsten);color:#fff;font-weight:600}-.follow .reviewtabs .fcheck svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}+.follow{padding:4px 0 42px}+.followhead{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}+.followhead .pagetitle{margin:0}+.follow .fcheck{height:40px;padding:0 16px;border:1px solid var(--tungsten);border-radius:var(--pill-radius);+ display:inline-flex;align-items:center;gap:6px;background:var(--tungsten);color:#fff;font-weight:600;cursor:pointer}+.follow .fcheck svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}+.followauthors{padding:0 0 10px;margin:0 0 2px}+.followauthors .av{width:76px}+.followauthors .av b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;+ font-size:var(--fs-xs);font-weight:500;color:var(--ink-2)}+.followauthors .av[aria-pressed="true"] .ring{box-shadow:0 0 0 2px var(--tungsten)}+.followauthors .favatar{width:64px;height:64px;border-radius:50%;outline:0}+.followauthors .favatar.none{font-size:var(--fs-lg);background:var(--overlay-5)}+.followfilters{position:relative;top:auto;z-index:1;height:auto;min-height:58px;margin:0 0 8px;+ padding:9px 0;border-bottom-color:transparent}+.followfilters .sep{flex:none;width:1px;height:24px;background:var(--line-soft);margin:0 3px}+.followfilters .pill .n{margin-left:5px;color:inherit}+.followfilternote{margin:-3px 0 12px}.fdetails summary{cursor:pointer;list-style:none}.fdetails summary::-webkit-details-marker{display:none}.fdetails summary::before{content:"› ";display:inline-block;transition:transform .12s}@@ -1190,14 +1205,6 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位.ficon{width:14px;height:14px;border-radius:3px;object-fit:contain;vertical-align:-2px;margin-right:5px}.fauthorhead .ficon{margin-right:2px}-.ffilter{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}-.ffilter button{display:inline-flex;align-items:center;border:1px solid var(--border-15);- border-radius:var(--pill-radius);background:transparent;color:var(--ink-2);- padding:5px 12px;cursor:pointer;font-size:var(--fs-xs)}-.ffilter button:hover{border-color:var(--tungsten);color:var(--ink)}-.ffilter button[aria-pressed="true"]{background:var(--tungsten-soft);- border-color:var(--tungsten);color:var(--tungsten);font-weight:600}-.ffilterlabel{align-self:center;margin-right:2px}.followlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr));gap:14px}.followitem{display:grid;grid-template-columns:150px minmax(0,1fr);gap:12px;background:var(--surface);border:1px solid var(--line-soft);border-radius:12px;padding:12px;min-width:0}.followitem[data-status="ignored"],.followitem[data-status="seen"]{opacity:.62}@@ -1231,10 +1238,8 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位.fstate{flex:1 1 100%;font-size:var(--fs-xs);color:var(--drop)}@media (max-width:640px){.followitem{grid-template-columns:110px minmax(0,1fr)}.followlist{grid-template-columns:1fr}- /* 标签条在窄屏是横滚的,「检查更新」跟着滚出视野——那是这页的主操作,- 不能要求先横滑才发现。窄屏下让它独占一行。 */- .follow .reviewtabs{flex-wrap:wrap;overflow-x:visible}- .follow .reviewtabs .fcheck{margin-left:0;flex:1 1 100%;justify-content:center}}+ .followhead{align-items:center}.follow .fcheck{height:36px;padding:0 13px}+ .followauthors{margin-right:-12px}.followfilters{margin-right:-12px;padding-right:12px}}/* ── 关注管理页 ──取证记录见 docs/reference-snapshots/vercel-geist-controls-measured.md。diff --git a/web/app.js b/web/app.jsindex b72d33b8c..87288f4a4 100644--- a/web/app.js+++ b/web/app.js@@ -26,7 +26,8 @@ const ROUTE_STATES=Object.fromEntries(Object.entries(STATE_ROUTES).map(([state,pconst STATE_LABELS={fresh:'没看过',later:'稍后看',flagged:'已标记'};const isCatalogPath=path=>path==='/'||Object.prototype.hasOwnProperty.call(ROUTE_STATES,path);const route=(path,replace=false)=>{- history[replace?'replaceState':'pushState']({},'',path);syncPageTitle(path);queueMicrotask(syncHeaderActions);+ history[replace?'replaceState':'pushState']({},'',path);syncPageTitle(path);+ queueMicrotask(()=>{syncHeaderActions();paintListTitle()});};const ENTITY_ROUTES={performer:'performers',studio:'studios',creator:'creators',series:'series'};const ROUTE_ENTITIES={performers:'performer',studios:'studio',creators:'creator',series:'series'};@@ -1384,9 +1385,11 @@ function renderFollow(){}if(!providers.has(source.provider))providers.set(source.provider,source.provider_label);});- const authors=new Map([...authorSources].map(([key,list])=>[key,followAuthorName(list)]));+ const authors=new Map([...authorSources].map(([key,list])=>[key,{+ name:followAuthorName(list),sources:list,+ }]));const topTags=[...tagCounts].sort((a,b)=>b[1]-a[1]).slice(0,20)- .map(([tag,n])=>[tag,`${tag} ${n}`]);+ .map(([tag,n])=>[tag,tagLabel(tag),n]);if(followAuthor&&!authors.has(followAuthor))followAuthor='';if(followProvider&&!providers.has(followProvider))followProvider='';if(followTag&&!tagCounts.has(followTag))followTag='';@@ -1398,23 +1401,26 @@ function renderFollow(){if(followTag&&!(group.primary&&group.primary.tags||[]).includes(followTag))return false;return true;});- const chips=(items,current,attr)=>items.length<2?'':`<div class="ffilter">`+- [['','全部'],...items].map(([key,label])=>- `<button data-${attr}="${esc(key)}" aria-pressed="${key===current}">${- attr==='follow-provider'&&key?sourceIcon(key):''}${esc(label)}</button>`).join('')+`</div>`;+ const providerPills=[['','全部来源'],...providers].map(([key,label])=>+ `<button class="pill" data-follow-provider="${esc(key)}" aria-pressed="${key===followProvider}">${+ key?sourceIcon(key):''}${esc(label)}</button>`).join('');$('#stats').innerHTML=`<div class="follow">- <h2 class="disp pagetitle">关注</h2>- <div class="reviewtabs">${FOLLOW_FILTERS.map(([key,label])=>- `<button data-follow-filter="${key}" aria-pressed="${key===followFilter}">${label}${- key?` <span class="n mono">${counts[key]||0}</span>`:''}</button>`).join('')}+ <div class="followhead"><h2 class="disp pagetitle">关注</h2><button class="fcheck" data-follow-manage>${icon('settings')}管理关注</button></div>- ${chips([...authors],followAuthor,'follow-author')}- ${chips([...providers],followProvider,'follow-provider')}- ${topTags.length?`<div class="ffilter"><span class="fmeta ffilterlabel">标签 · 只有 ${- TAGGED_PROVIDERS.map(provider=>esc(providers.get(provider)||provider)).join('、')} 提供</span>`+- [['','全部'],...topTags].map(([key,label])=>- `<button data-follow-tag="${esc(key)}" aria-pressed="${key===followTag}">${esc(label)}</button>`- ).join('')+`</div>`:''}+ ${authors.size?`<div class="tier followauthors" aria-label="按作者筛选">${[...authors].map(([key,author])=>+ `<button class="av" data-follow-author="${esc(key)}" aria-pressed="${key===followAuthor}">+ <span class="ring">${followAuthorAvatar(author.sources)}</span><b>${esc(author.name)}</b></button>`+ ).join('')}</div>`:''}+ <div class="tagbar followfilters" aria-label="关注筛选">${FOLLOW_FILTERS.map(([key,label])=>+ `<button class="pill" data-follow-filter="${key}" aria-pressed="${key===followFilter}">${label}${+ key?` <span class="n mono">${counts[key]||0}</span>`:''}</button>`).join('')}+ <span class="sep" aria-hidden="true"></span>${providerPills}+ ${topTags.length?`<span class="sep" aria-hidden="true"></span>`++ [['','全部标签',0],...topTags].map(([key,label,n])=>+ `<button class="pill" data-follow-tag="${esc(key)}" aria-pressed="${key===followTag}">${+ esc(label)}${n?` <span class="n mono">${n}</span>`:''}</button>`).join(''):''}</div>+ ${topTags.length?`<p class="fmeta followfilternote">内容标签目前由 ${+ TAGGED_PROVIDERS.map(provider=>esc(providers.get(provider)||provider)).join('、')} 提供</p>`:''}${broken.length?`<p class="fwarn">${broken.length} 个来源上次检查失败,去<button class="flink" data-follow-manage>管理关注</button>看原因。</p>`:''}${followCheckReport?followCheckSummary(followCheckReport):''}@@ -1432,7 +1438,7 @@ function renderFollow(){$('#stats').querySelectorAll('[data-follow-filter]').forEach(button=>button.onclick=()=>{followFilter=button.dataset.followFilter;openFollow(false)});$('#stats').querySelectorAll('[data-follow-author]').forEach(button=>button.onclick=()=>{- followAuthor=button.dataset.followAuthor;renderFollow()});+ followAuthor=followAuthor===button.dataset.followAuthor?'':button.dataset.followAuthor;renderFollow()});$('#stats').querySelectorAll('[data-follow-provider]').forEach(button=>button.onclick=()=>{followProvider=button.dataset.followProvider;renderFollow()});$('#stats').querySelectorAll('[data-follow-tag]').forEach(button=>button.onclick=()=>{@@ -1955,7 +1961,7 @@ const TAG_CATEGORIES=[['all','全部'],['meta','影片属性'],['relationship','['position','性交体位'],['general','其他内容']];const TAG_DISPLAY_NAMES={'1080P':'1080p','60fps':'60FPS','AI去码':'AI解码','淫语ASMR':'ASMR','JK制服':'JK','OL制服':'OL','眼镜':'眼镜娘','情趣内衣':'性感内衣',- '口罩遮脸':'口罩','强制剧情':'强制','足交':'脚交','深喉':'深喉咙','骑乘':'骑乘位',+ '口罩遮脸':'口罩','强制剧情':'强制','足交':'脚交','骑乘':'骑乘位','后入':'背后位','3P多人':'3P','双洞齐插':'双洞齐下','毒龙':'毒龙钻'};const tagLabel=tag=>TAG_DISPLAY_NAMES[tag]||tag;const selectedIndexTags=new Set();@@ -2514,7 +2520,8 @@ function paintManageTitle(){}function paintListTitle(){const el=$('#listTitle');if(!el)return;- const label=!manageSection()?STATE_LABELS[state.state]||'':'';+ const path=decodeURIComponent(location.pathname);+ const label=!manageSection()&&isCatalogPath(path)?STATE_LABELS[state.state]||'':'';el.hidden=!label;if(label)el.textContent=label;}function openManage(section='stats'){