feat(sites): on-demand site detail page content (INT-2)

- SiteReleaseDetail.page: description, MediaInfo/BDInfo, screenshots,
  IMDb / Douban / TMDB ids, file list, tags, uploader, plus a parse probe
  (labels found) for layout-change diagnosis. Generic NexusPHP rules
  (field label -> next sibling) starting from the MovieClaw detail
  selectors; site overrides under umt.detail.page (HHClub: div labels).
  M-Team builds the same structure from descr BBCode + mediainfo.
- Fetched only on demand (drawer open without cache, "复核详情",
  release.inspect); content in kv_cache region site.detail for the
  site detail cache period (>= 24 h); within the window the site is not
  requested again. External ids persist in source_release.raw._detail,
  which list snapshots do not overwrite.
- Screenshots only as proxy paths /api/v1/img/site-detail/{rid}/{i}:
  public-address check on every hop, no site credentials, magic-byte
  image check, 8 MB cap. Poster proxy shares the same helper.
- Identity: site ids count as explicit-id evidence; when TMDB is
  queried, a TMDB id goes straight to details and an IMDb id to
  /find (no title search on a hit). Douban only for local recall.
- Release drawer "站点详情页" section; fixtures and tests for HHClub div
  layout, rowhead layout, BBCode, cache/proxy/identity end to end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 16:21:17 +08:00
1 parent 6e9e8efec2
commit 04cffcd1f1
30 files changed
+1133 -64

No files matched your search

+22
View File
@@ -636,6 +636,24 @@ export const WorkbenchReleasePage = z.object({
});
export type WorkbenchReleasePage = z.infer<typeof WorkbenchReleasePage>;
/**
* 站点详情页扩展内容(按需抓详情时得到,服务端缓存 24 小时;过期后需再次复核详情)。
* 截图地址是服务端图片代理路径(/api/v1/img/site-detail/{releaseId}/{index}),不直连外站。
*/
export const SiteReleasePage = z.object({
fetchedAt: Timestamp,
descriptionText: z.string().nullable(),
mediaInfo: z.string().nullable(),
screenshots: z.array(z.object({ url: z.string(), host: z.string() })),
imdbId: z.string().nullable(),
doubanId: z.string().nullable(),
tmdb: z.object({ type: z.enum(["movie", "tv"]), id: z.string() }).nullable(),
files: z.array(z.object({ name: z.string(), sizeBytes: z.number().int().nullable() })),
tags: z.array(z.string()),
uploader: z.string().nullable(),
});
export type SiteReleasePage = z.infer<typeof SiteReleasePage>;
export const WorkbenchReleaseDetail = z.object({
release: WorkbenchRelease,
observations: z.array(
@@ -657,5 +675,9 @@ export const WorkbenchReleaseDetail = z.object({
}),
/** 刷新详情失败时保留既有数据并给出原因 */
refreshError: z.string().nullable(),
/** 详情页扩展内容;没抓过、缓存已过期或站点不支持详情页时为 null */
page: SiteReleasePage.nullable(),
/** 站点能否抓详情页(false 时前端不自动抓) */
detailSupported: z.boolean(),
});
export type WorkbenchReleaseDetail = z.infer<typeof WorkbenchReleaseDetail>;