Skip to content

armgit / peach

Public Imported from GitHub
0

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

feat(feeds): 人物页一键订阅新作,地址按 JavDB 演员页自动生成

longmeidao63dba3dd06cb
diff --git a/frontend/e2e/design.test.ts b/frontend/e2e/design.test.ts
index 8ceb4a606..d869d0cf7 100644
--- a/frontend/e2e/design.test.ts
+++ b/frontend/e2e/design.test.ts
@@ -1219,4 +1219,43 @@ describe('设计决定', () => {
await opened.close();
}
});
+
+ it('浅色下看片那两枚标识悬停时有底,资料卡上带订阅新作开关', { timeout: 60_000 }, async () => {
+ // 演示库里没有人物实体:资料由这里给,入口与开关字段照服务端拼好下发的形状写。
+ const name = '七沢みあ';
+ const opened = await visit(browser, '/', DESKTOP);
+ try {
+ await opened.page.route(/\/api\/entity\?/, (route) => route.fulfill({ json: {
+ id: 90_001, kind: 'performer', canonical_name: name, aliases: [], display_aliases: [],
+ user_aliases: [], asset_count: 0, tags: [], related_performers: [], links: [],
+ metadata: {}, has_image: false, has_avatar: false, avatar_focus: null,
+ representative_asset_id: null,
+ entry_links: [{ site: 'javdb', label: 'JavDB', ordinal: '', slot: 'mark',
+ mark: 'mark-javdb', url: 'https://javdb.com/actors/NPD3' }],
+ feed: { following: false },
+ } }));
+ await opened.page.goto(new URL(`/performers/${encodeURIComponent(name)}`,
+ opened.page.url()).href, { waitUntil: 'load' });
+ const mark = opened.page.locator('.entrymarks a.entrymark').first();
+ await mark.waitFor({ timeout: 15_000 });
+ await settle(opened.page);
+ // 浅色下 `--hover` 与资料卡的 `--ground` 同是 #f5f5f5,垫上去等于没垫。
+ await opened.page.evaluate(() => {
+ document.documentElement.dataset.theme = 'light';
+ document.documentElement.classList.remove('dark');
+ });
+ await mark.hover();
+ const faces = await mark.evaluate((element) => ({
+ mark: getComputedStyle(element).backgroundColor,
+ card: getComputedStyle(element.closest('.entityhero')!).backgroundColor,
+ }));
+ assert.notEqual(faces.mark, 'rgba(0, 0, 0, 0)', '悬停没有垫底');
+ assert.notEqual(faces.mark, faces.card, '悬停底色和资料卡同色,看不出来');
+ const toggle = opened.page.getByRole('switch', { name: '订阅新作' });
+ assert.equal(await toggle.count(), 1, '资料卡上没有订阅新作开关');
+ assert.equal(await toggle.isChecked(), false);
+ } finally {
+ await opened.close();
+ }
+ });
});
diff --git a/src/peach/entry_links.py b/src/peach/entry_links.py
index 6c17b496b..70b9a97c4 100644
--- a/src/peach/entry_links.py
+++ b/src/peach/entry_links.py
@@ -296,3 +296,14 @@ def build(settings: dict, canonical_name: str, refs, aliases=()) -> list[dict]:
def entry_links(root: Path, canonical_name: str, refs, aliases=()) -> list[dict]:
"""读设置并拼出入口。资料页只调这一个。"""
return build(read(root), canonical_name, refs, aliases)
+
+
+def javdb_actor_pages(canonical_name: str, refs) -> list[str]:
+ """这位在 JavDB 上的演员页,人物页「订阅新作」拉的就是这几页(ADR-0042)。
+
+ 和页面上那枚入口同一套判据,只是域名不跟配置页的镜像走:拉取按主机计间隔与冷却,
+ 预算登记在 `javdb.com` 名下,换了镜像就绕开了那份预算;镜像日后换掉,存下来的订阅
+ 地址也不必跟着改。
+ """
+ return [row["url"] for row in build(defaults(), canonical_name, refs)
+ if row["site"] == "javdb"]
diff --git a/src/peach/feeds.py b/src/peach/feeds.py
index 576ce77f0..137a425b7 100644
--- a/src/peach/feeds.py
+++ b/src/peach/feeds.py
@@ -260,6 +260,40 @@ def add_source(connection: sqlite3.Connection, *, kind: str, url: str, name: str
return int(cursor.lastrowid)
+def follow_entity(connection: sqlite3.Connection, entity_id: int, urls) -> list[int]:
+ """人物页那枚开关打开:这位的每个 JavDB 演员页各一条源,全部启用。
+
+ 地址已经登记过的(设置页手动加过、或者之前关掉过)原地启用并补上人物,不另建一条:
+ `feed_item` 的去重记忆挂在那条源上,重建一条等于让整页历史再被当成新作一遍。
+ """
+ ids: list[int] = []
+ for url in urls:
+ address = normalize_url(url)
+ row = connection.execute(
+ "SELECT id FROM feed_source WHERE url=?", (address,)).fetchone()
+ if row is None:
+ ids.append(add_source(connection, kind=KIND_JAVDB_ACTOR, url=address,
+ entity_id=int(entity_id)))
+ continue
+ connection.execute(
+ "UPDATE feed_source SET enabled=1, entity_id=coalesce(entity_id, ?) WHERE id=?",
+ (int(entity_id), int(row["id"])))
+ ids.append(int(row["id"]))
+ return ids
+
+
+def unfollow_entity(connection: sqlite3.Connection, entity_id: int) -> None:
+ """开关关掉:只停用不删除,再打开时这几条的去重记忆接着用。"""
+ connection.execute("UPDATE feed_source SET enabled=0 WHERE entity_id=? AND kind=?",
+ (int(entity_id), KIND_JAVDB_ACTOR))
+
+
+def entity_following(connection: sqlite3.Connection, entity_id: int) -> bool:
+ return connection.execute(
+ "SELECT 1 FROM feed_source WHERE entity_id=? AND kind=? AND enabled=1",
+ (int(entity_id), KIND_JAVDB_ACTOR)).fetchone() is not None
+
+
def remove_source(connection: sqlite3.Connection, source_id: int) -> None:
connection.execute("DELETE FROM feed_source WHERE id=?", (int(source_id),))
diff --git a/src/peach/web_entity.py b/src/peach/web_entity.py
index b18b0d916..d9b928c08 100644
--- a/src/peach/web_entity.py
+++ b/src/peach/web_entity.py
@@ -14,7 +14,7 @@ import time
from urllib.parse import urlsplit
-from . import entry_links
+from . import entry_links, feeds
from .catalog_rules import LENGTH_TAGS, dir_expr, photo_set_title, tag_cat
from .entities import normalize_entity_name, resolve_entity, rewrite_flat_projection
from .web_catalog import (
@@ -55,6 +55,20 @@ INDEX_ENTITY_KINDS = {"performers": "performer", "creators": "creator",
"studios": "studio", "agencies": "agency"}
+def _performer_entries(contract: WebContract, c, d: dict, alias_rows) -> dict:
+ """女优资料卡上的外部入口,和「订阅新作」开关。
+
+ 入口下发的是拼好的地址,不是模板:拼它要的站点 id、规范名和别名都在服务端,
+ 前端再拼一遍就会有两份规则。缺 id 的站点不出现在这个列表里。开关只在她有
+ JavDB 演员页时出现,订阅地址同样由服务端拼,页面只管开和关。
+ """
+ out = {"entry_links": entry_links.entry_links(
+ contract.entry_links_root, d["canonical_name"], d["external_refs"], alias_rows)}
+ if entry_links.javdb_actor_pages(d["canonical_name"], d["external_refs"]):
+ out["feed"] = {"following": feeds.entity_following(c, d["id"])}
+ return out
+
+
def q_entity(contract: WebContract, args):
"""女优、厂牌、事务所等实体的资料页。
@@ -115,12 +129,8 @@ def q_entity(contract: WebContract, args):
"ORDER BY provider,external_kind,external_id",
(d["id"],),
)]
- # 外部入口下发的是拼好的地址,不是模板:拼它要的站点 id、规范名和别名都在服务端,
- # 前端再拼一遍就会有两份规则。缺 id 的站点不出现在这个列表里。
- d["entry_links"] = (
- entry_links.entry_links(contract.entry_links_root, d["canonical_name"],
- d["external_refs"], alias_rows)
- if kind == "performer" else [])
+ d.update(_performer_entries(contract, c, d, alias_rows) if kind == "performer"
+ else {"entry_links": []})
scope = scope_predicate(kind, "ae.entity_id")
count, rep = c.execute(
"SELECT count(DISTINCT ae.asset_id),"
diff --git a/src/peach/web_feeds.py b/src/peach/web_feeds.py
index 76880b444..8cfef8021 100644
--- a/src/peach/web_feeds.py
+++ b/src/peach/web_feeds.py
@@ -10,7 +10,8 @@ import threading
import time
import uuid
-from . import feed_followup, feeds
+from . import entry_links, feed_followup, feeds
+from .jobs import TaskRunConflict
from .http import HttpRequest, public_https_url
#: 一次拉取的超时与体积上限。一份 RSS 正常几十到几百 KB;JavDB 演员页 78 KB。
@@ -197,6 +198,8 @@ def w_feed_source(contract, body) -> dict:
with contract.database.write_transaction() as connection:
feeds.set_enabled(connection, source_id, enabled)
return {"ok": True, "source": source_id, "enabled": enabled}
+ if action == "follow":
+ return _follow_entity(contract, body)
if action != "add":
raise ValueError(f"unknown feed source action: {action}")
entity_id = body.get("entity_id")
@@ -209,6 +212,42 @@ def w_feed_source(contract, body) -> dict:
return {"ok": True, "source": source_id}
+def _follow_entity(contract, body) -> dict:
+ """人物页「订阅新作」开关。地址按这位的 JavDB 演员页现拼,不收页面传来的地址。
+
+ 打开后当场在后台拉这几条:人物页上点开关的人要的是马上看到她有哪些新作,
+ 而不是等下一轮到期扫描。已有一轮在跑时就交给那一轮之后的到期扫描——
+ 新源 `next_fetch_at` 为空,下一轮一定带上它。
+ """
+ entity_id, enabled = body.get("entity_id"), body.get("enabled")
+ if not isinstance(entity_id, int) or not isinstance(enabled, bool):
+ raise ValueError("entity_id must be an integer and enabled must be a boolean")
+ with contract.database.write_transaction() as connection:
+ row = connection.execute(
+ "SELECT canonical_name FROM entity WHERE id=? AND kind='performer'",
+ (entity_id,)).fetchone()
+ if row is None:
+ raise ValueError("找不到这位女优")
+ if not enabled:
+ feeds.unfollow_entity(connection, entity_id)
+ ids: list[int] = []
+ else:
+ refs = [dict(ref) for ref in connection.execute(
+ "SELECT provider,external_kind,external_id FROM entity_external_ref"
+ " WHERE entity_id=?", (entity_id,))]
+ pages = entry_links.javdb_actor_pages(row["canonical_name"], refs)
+ if not pages:
+ raise ValueError("这位在 JavDB 上没有演员页编号")
+ ids = feeds.follow_entity(connection, entity_id, pages)
+ contract.cache_bust()
+ if ids:
+ try:
+ w_feed_check(contract, {"sources": ids, "background": True})
+ except TaskRunConflict:
+ pass
+ return {"ok": True, "entity_id": entity_id, "following": enabled, "sources": ids}
+
+
#: 列表一次给多少条。首页那一块只放一行,人物页给一屏。
DISCOVERY_LIMIT = 24
diff --git a/tests/test_entry_links.py b/tests/test_entry_links.py
index 48e9c02e2..6ff60b527 100644
--- a/tests/test_entry_links.py
+++ b/tests/test_entry_links.py
@@ -126,6 +126,13 @@ class EntryLinkAddressTests(unittest.TestCase):
rows = entry_links.build(settings, "七沢みあ", [ref("javdb", "NPD3")])
self.assertEqual(rows[0]["url"], "https://javdb521.com/actors/NPD3")
+ def test_the_feed_address_stays_on_javdb_whatever_the_mirror(self):
+ """订阅地址按主机计限流预算,跟着镜像走就绕开了 `javdb.com` 那份预算。"""
+ self.assertEqual(entry_links.javdb_actor_pages("七沢みあ", [ref("javdb", "NPD3")]),
+ ["https://javdb.com/actors/NPD3"])
+ self.assertEqual(entry_links.javdb_actor_pages(
+ "145cm色白お嬢様", [ref("stash", "12")]), [])
+
def test_a_broken_domain_falls_back_to_the_default_site(self):
"""手改坏的域名拼出来是个不存在的主机名,那比退回默认站更难看出问题。"""
settings = entry_links.defaults()
diff --git a/tests/test_fastapi_api.py b/tests/test_fastapi_api.py
index 7d3cff69b..69961c16b 100644
--- a/tests/test_fastapi_api.py
+++ b/tests/test_fastapi_api.py
@@ -240,8 +240,8 @@ class FastApiContractTests(unittest.IsolatedAsyncioTestCase):
(self.root / "dist" / "peach-ui.css").write_text(".island{}", encoding="utf-8")
con = sqlite3.connect(self.db)
con.executescript(BASE_SCHEMA)
- con.executescript((ROOT / "migrations" / "0018_online_follow.sql").read_text(
- encoding="utf-8"))
+ for migration in ("0018_online_follow.sql", "0034_feed_discovery.sql"):
+ con.executescript((ROOT / "migrations" / migration).read_text(encoding="utf-8"))
con.execute(
"""INSERT INTO asset(id,location,path,name,medium,size,creator,studio,duration,
width,height,ctx_orient,snapshot_path,first_seen)
diff --git a/tests/test_feeds_web.py b/tests/test_feeds_web.py
index d5b4f89a2..ee3799809 100644
--- a/tests/test_feeds_web.py
+++ b/tests/test_feeds_web.py
@@ -55,7 +55,9 @@ class FakeTransport:
return self.responses[request.url]
-class FeedWebTest(unittest.TestCase):
+class FeedWebFixture(unittest.TestCase):
+ """临时账本、本地 feed 字节和替掉的取资料一步。不带用例,两个套件共用。"""
+
def setUp(self):
self.temporary = tempfile.TemporaryDirectory()
self.addCleanup(self.temporary.cleanup)
@@ -108,6 +110,8 @@ class FeedWebTest(unittest.TestCase):
finally:
web_feeds._transport = original
+
+class FeedWebTest(FeedWebFixture):
def test_settings_snapshot_lists_the_source_and_its_kinds(self):
self._add()
snapshot = dispatch_api_get(self.contract, "/api/feeds", {})
@@ -250,5 +254,120 @@ class FeedWebTest(unittest.TestCase):
{"action": "delete", "ids": [1]})
+#: JavDB 演员页里两部作品,形状照 `test_feeds.JAVDB_ACTOR` 那份抓回来的 HTML。
+JAVDB_PAGE = """
+<a href="/v/5nr8mp" class="box" title="x"><div class="video-title"><strong>PBD-528</strong>
+ 気高きお姉さん達</div><div class="meta">
+ 2026-10-20</div></a>
+<a href="/v/RkPb5z" class="box" title="x"><div class="video-title"><strong>BBSS-106</strong>
+ 別の作品</div><div class="meta">
+ 2026-10-13</div></a>
+"""
+
+
+class PerformerFeedSwitchTest(FeedWebFixture):
+ """人物页「订阅新作」开关:地址由服务端按 JavDB 演员页拼,页面只送开和关。"""
+
+ def setUp(self):
+ super().setUp()
+ self.page = "https://javdb.com/actors/pRMq"
+ self.transport.responses[self.page] = HttpResponse(
+ 200, {"Content-Type": "text/html"}, JAVDB_PAGE.encode("utf-8"), self.page)
+ original = web_feeds._transport
+ web_feeds._transport = lambda contract: self.transport
+ self.addCleanup(lambda: setattr(web_feeds, "_transport", original))
+ self.performer = self._performer("凉森れむ", ["pRMq"])
+
+ def _performer(self, name, javdb_ids):
+ with self.contract.database.write_transaction() as connection:
+ entity_id = int(connection.execute(
+ "INSERT INTO entity(kind,canonical_name,normalized_name,created_at,updated_at)"
+ " VALUES('performer',?,peach_normalize(?),?,?)",
+ (name, name, feeds.stamp(), feeds.stamp())).lastrowid)
+ for external_id in javdb_ids:
+ connection.execute(
+ "INSERT INTO entity_external_ref(entity_id,provider,external_kind,"
+ "external_id) VALUES(?,'javdb','performer',?)", (entity_id, external_id))
+ return entity_id
+
+ def _switch(self, enabled, entity_id=None):
+ return dispatch_api_post(self.contract, "/api/feeds/source", {
+ "action": "follow", "entity_id": entity_id or self.performer,
+ "enabled": enabled})
+
+ def _settled(self):
+ deadline = time.monotonic() + 5.0
+ while time.monotonic() < deadline:
+ state = self.contract.feed_job.snapshot() or {}
+ if state.get("status") not in ("running", None):
+ return state
+ time.sleep(0.02)
+ self.fail("订阅拉取没有在 5 秒内跑完")
+
+ def _sources(self):
+ return dispatch_api_get(self.contract, "/api/feeds", {})["sources"]
+
+ def test_switching_on_subscribes_her_javdb_page_and_fetches_it_now(self):
+ result = self._switch(True)
+ self.assertTrue(result["following"])
+ [source] = self._sources()
+ self.assertEqual((source["kind"], source["url"], source["entity_id"]),
+ (feeds.KIND_JAVDB_ACTOR, self.page, self.performer))
+ # 名字不另存,跟着人物走。
+ self.assertEqual(source["name"], "凉森れむ")
+ self.assertEqual(self._settled()["added"], 2)
+ mine = dispatch_api_get(self.contract, "/api/feeds/discoveries",
+ {"entity": self.performer})
+ self.assertEqual([item["code"] for item in mine["items"]], ["PBD-528", "BBSS-106"])
+
+ def test_switching_off_pauses_and_switching_on_again_reuses_the_source(self):
+ self._switch(True)
+ self._settled()
+ self._switch(False)
+ [paused] = self._sources()
+ self.assertFalse(paused["enabled"])
+ self._switch(True)
+ self._settled()
+ [again] = self._sources()
+ self.assertEqual(again["id"], paused["id"])
+ self.assertTrue(again["enabled"])
+
+ def test_a_page_added_by_hand_is_adopted_instead_of_duplicated(self):
+ dispatch_api_post(self.contract, "/api/feeds/source", {
+ "action": "add", "kind": feeds.KIND_JAVDB_ACTOR, "url": self.page})
+ self._switch(True)
+ self._settled()
+ [source] = self._sources()
+ self.assertEqual(source["entity_id"], self.performer)
+
+ def test_every_javdb_page_of_hers_gets_its_own_source(self):
+ twice = self._performer("释爱丽丝", ["d45k9", "ZX5z7"])
+ result = self._switch(True, twice)
+ self._settled()
+ self.assertEqual(len(result["sources"]), 2)
+ self.assertEqual(sorted(source["url"] for source in self._sources()),
+ ["https://javdb.com/actors/ZX5z7", "https://javdb.com/actors/d45k9"])
+
+ def test_the_profile_carries_the_switch_only_when_she_has_a_javdb_page(self):
+ profile = dispatch_api_get(self.contract, "/api/entity",
+ {"kind": "performer", "name": "凉森れむ"})
+ self.assertEqual(profile["feed"], {"following": False})
+ self._switch(True)
+ self._settled()
+ profile = dispatch_api_get(self.contract, "/api/entity",
+ {"kind": "performer", "name": "凉森れむ"})
+ self.assertEqual(profile["feed"], {"following": True})
+ self._performer("無名の人", [])
+ bare = dispatch_api_get(self.contract, "/api/entity",
+ {"kind": "performer", "name": "無名の人"})
+ self.assertNotIn("feed", bare)
+
+ def test_a_performer_without_a_javdb_page_is_refused(self):
+ bare = self._performer("無名の人", [])
+ with self.assertRaises(ValueError):
+ self._switch(True, bare)
+ self.assertEqual(self._sources(), [])
+
+
if __name__ == "__main__": # pragma: no cover
unittest.main()
diff --git a/tests/test_source_assertion_ratchet.py b/tests/test_source_assertion_ratchet.py
index 0e176fadc..36e714897 100644
--- a/tests/test_source_assertion_ratchet.py
+++ b/tests/test_source_assertion_ratchet.py
@@ -53,7 +53,7 @@ BASELINE: dict[str, int] = {
"test_web_e2e.py": 2,
"test_web_js.py": 1,
"test_web_settings.py": 8,
- "test_web_ui.py": 4593,
+ "test_web_ui.py": 4592,
"test_windows_update.py": 3,
}
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 67f71e11d..069d5d479 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -2274,11 +2274,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(
".entrymarks{display:flex;flex-wrap:wrap;align-items:center;gap:32px;"
"margin-top:14px;max-width:100%}")
- # 标识自己就说清了是哪家,不套药丸;hover 用 Board 那块 --hover。
- # 选择器要压过 board.css 里按 [target=_blank] 把外链染蓝、抹平内边距的那条。
- self.assertPageContains(
- ".entityhero .entrymarks a.entrymark:any-link:hover"
- "{background:var(--hover);text-decoration:none}")
+ # 悬停底色是设计决定,按计算值量在 `frontend/e2e/design.test.ts`。
self.assertPageContains(".entrymark svg{height:22px;width:auto}")
self.assertPageContains(".entityhero .entrymarks{justify-content:center}")
diff --git a/web/app.js b/web/app.js
index 2a1a6d486..8a21e6429 100644
--- a/web/app.js
+++ b/web/app.js
@@ -4665,6 +4665,42 @@ async function renderFeedNew(host,entityId){
wireHorizontalScroller(host.querySelector('.feednewrow'));
}
+/* 人物页「订阅新作」开关。地址不经页面:服务端按这位的 JavDB 演员页现拼,页面只送
+ 开或关。打开时服务端当场在后台拉一轮,拉完这里把「新作 · 未入库」那一行重画一次;
+ 等的上限是那一轮自己的时长量级,页面换走了就不再等。 */
+const ENTITY_FEED_WAIT_TRIES=40;
+function wireEntityFeed(entityId){
+ const toggle=$('#index').querySelector('[data-entity-feed]');
+ if(!toggle||!entityId)return;
+ const onPage=()=>$('#index').contains(toggle);
+ const write=async on=>{
+ setActionBusy(toggle);
+ try{
+ await api('/api/feeds/source',{method:'POST',
+ body:JSON.stringify({action:'follow',entity_id:entityId,enabled:on})});
+ toggle.checked=on;
+ return true;
+ }catch(error){
+ toggle.checked=!on;actionFailure(on?'订阅新作':'取消订阅新作',error);
+ return false;
+ }finally{setActionBusy(toggle,false)}
+ };
+ const refreshAfterCheck=async()=>{
+ for(let tries=0;tries<ENTITY_FEED_WAIT_TRIES&&onPage();tries+=1){
+ await new Promise(resolve=>setTimeout(resolve,3000));
+ const job=await api('/api/feeds/check').catch(()=>null);
+ if(!job||job.status!=='running')break;
+ }
+ if(onPage())void renderFeedNew($('#index').querySelector('[data-feed-new]'),entityId);
+ };
+ toggle.onchange=async()=>{
+ const on=toggle.checked;
+ if(!await write(on))return;
+ actionReceipt(on?'已订阅新作':'已取消订阅新作',{undo:async()=>{await write(!on)}});
+ if(on)void refreshAfterCheck();
+ };
+}
+
/* 外链是别人服务器上的东西,会在我们不知情的时候烂掉——实测 719 条里 152 条打不开,
而它们在资料页上和好链接长得一模一样,只有点下去才知道。所以检查要能随时重跑,
不是一次性脚本。放在资源同步上面:两块都是「把库里的记录和外部现实对齐」。 */
@@ -7998,7 +8034,8 @@ async function openEntity(kind,name,push=true){
`<a class="entrymark" href="${esc(x.url)}" target="_blank" rel="noreferrer" title="${esc(x.label)}">${
x.mark?icon(x.mark):'<span class="missavmark"><span>MISS</span><span>AV</span></span>'
}${x.ordinal?`<span class="entryordinal">${esc(x.ordinal)}</span>`:''}<span class="sr-only">${esc(x.label)}</span></a>`
- ).join('');
+ ).join('')+(d.feed?`<label class="entryfeed">${icon('rss')}<span>订阅新作</span><input type="checkbox"
+ class="ptoggle" role="switch" data-entity-feed ${d.feed.following?'checked':''}></label>`:'');
const tags=(d.tags||[]).map(x=>filterChipHtml(tagLabel(x.k),{attr:'data-entity-tag',value:x.k,selected:tagPressed(filters.tag,x.k),count:x.n.toLocaleString()})).join('');
/* 事务所名下的这批人不摆在这排小圆头像里:那是「同台艺人」,一条附注;名册是这一页
的正文,占的是下面那整块。所以同一份 `related_performers` 在事务所页走另一条路。 */
@@ -8115,6 +8152,7 @@ async function openEntity(kind,name,push=true){
wireHorizontalScroller($('#index').querySelector('.entitytags'));
wireHorizontalScroller($('#index').querySelector('.entitytagbar .filterscroll'));
wireNamePicker(kind,d.canonical_name,d.user_aliases||[]);
+ wireEntityFeed(Number(d.id));
entityPhotos=photos&&!photos.error?photos:null;
if(entityMediaView.media==='photos'&&!photoTotalOf())entityMediaView=emptyMediaView();
renderEntityMediaToggle(kind,name,filters);
diff --git a/web/css/07-entity.css b/web/css/07-entity.css
index 4f9f2a1ee..ca20550c6 100644
--- a/web/css/07-entity.css
+++ b/web/css/07-entity.css
@@ -79,8 +79,9 @@
.entitylinks a.urllink{letter-spacing:.02em}
/* 看片的那一行:两站自己的横向标识排在一起,不套药丸。标识本身已经说清是哪家,再画
一圈框、再写一遍站名,说的是同一件事,占的却是三倍高度。
- 高度统一 22px、按标识自己的比例定宽;hover 用 Board 那块 `--hover` 垫一层,圆角走
- `--control-radius`,负外边距让垫层不把这一行撑开;32px 的间距减掉左右各 8px 的垫层,
+ 高度统一 22px、按标识自己的比例定宽;hover 垫一层与上面那排外链同一档的填充,圆角走
+ `--control-radius`,负外边距让垫层不把这一行撑开。`--hover` 用不得:浅色下它和资料卡
+ 的 `--ground` 同是 #f5f5f5,垫上去看不见。32px 的间距减掉左右各 8px 的垫层,
两枚标识之间还剩 16px,看着才是两条链接而不是一长条。
选择器写得这么长是为了压过 board.css 里「一句话就是一个链接」那条:它按 `[target=_blank]`
收所有外链,把字染蓝、抹平内边距,标识里跟着墨色走的那半会一起变蓝。那条算三个类,
@@ -88,7 +89,12 @@
.entrymarks{display:flex;flex-wrap:wrap;align-items:center;gap:32px;margin-top:14px;max-width:100%}
.entityhero .entrymarks a.entrymark:any-link{display:inline-flex;align-items:center;gap:6px;min-width:0;
text-decoration:none;color:var(--ink);border-radius:var(--control-radius);padding:4px 8px;margin:-4px -8px}
-.entityhero .entrymarks a.entrymark:any-link:hover{background:var(--hover);text-decoration:none}
+.entityhero .entrymarks a.entrymark:any-link:hover{
+ background:color-mix(in srgb,var(--ink) 8%,var(--ground));text-decoration:none}
+/* 「订阅新作」开关排在两枚标识后面:它订的就是左边那个 JavDB 演员页。 */
+.entryfeed{display:inline-flex;align-items:center;gap:8px;color:var(--ink);font-size:var(--fs-sm);
+ cursor:pointer}
+.entryfeed svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2}
/* 标识自己带着 fill:蓝块和白字是站点的配色,`currentColor` 那半跟页面墨色走。
这里只定高,宽度由外层 viewBox 的比例推出来。 */
.entrymark svg{height:22px;width:auto}