Files
UHD_Media_Tool/packages/adapters
rootandClaude Opus 5.5 9be9813021 feat(sites): structure release detail pages and rework the detail drawer (DETAIL-1)
Adapters (pure functions + tests):
- detail-description: strip HTML/BBCode residue, drop site template blocks and
  ad/signature lines (configurable rules), parse PT info blocks (◎ / 【】 / 『』 /
  「键:」) into infoBlock and body paragraphs
- mediainfo: MediaInfo and BDInfo (quick summary + full report) into a summary
  of container/duration/bitrate/size, video (HDR/DV), audio and subtitle tracks
- file-tree: file list into a flattened directory tree with sizes and
  main/sample/subtitle/extra roles
- formatDetailPage combines them; the server computes it when reading the
  cached detail page, so existing caches benefit without a refetch

Contracts: SiteReleasePage gains infoBlock, paragraphs, media, fileTree.

Web: drawer now reads top-down: meta row (promo/H&R, size, peers, upload time,
IMDb/TMDB/豆瓣 tags) → 资料 → 简介 (collapsible) → 技术规格 (raw folded) →
截图 grid with keyboard lightbox → 文件 tree; inventory overlay moved into the
fixed footer next to 下载.

Fixtures: 6 desensitized samples from the local cache (site.detail and RSS
descriptions) plus synthetic multi-track MediaInfo, BDInfo, bracket blocks and
directory file lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 20:50:42 +08:00
..
2026-09-29 03:27:14 +08:00

@umt/adapters

外部系统适配层:qBittorrent、RSS、站点(观众 NexusPHP / 馒头 API)、TMDB、Emby 兼容服务器、浏览器服务与文件系统。对上只暴露端口接口,凭证经 secret reference 注入,日志一律脱敏(键表与规则取 @umt/contracts 的 redact.ts)。

包入口 src/index.ts 逐个 export * 下列子模块:

子模块 主要入口 说明
qbittorrent createQbClient / QbClient、DownloaderRegistry、assertSafeToDeleteData、mapQbState qB WebUI v2:提交、标签接管、暂停/恢复、带安全校验的删数据
rss createRssFetcher、applyFeedItems、redactUrl、buildRssLinkRequest RSS 2.0 / RDF / Atom 抓取解析、条件请求、退避熔断、去重
sites createSiteAdapter / getSiteAdapter、listSiteDefinitions、siteFetch 观众(NexusPHP 配置驱动 spider)与馒头 M-Team API
tmdb createTmdbClient / TmdbClient、matchTmdb、matchTmdbMulti、TmdbError 多语言搜索、详情、季集;缓存限流;错误信息不带 api_key
emby createEmbyClient / EmbyClient、MediaServerRegistry Emby / Jellyfin 库存查询,失败返回 unknown 而不是"不存在"
fs copyWithVerify、moveSafe、crossDeviceMove、checkRoot、scanIncremental、diskUsage、ffprobe、FsProxy;另有子路径导出 @umt/adapters/fsworker(fsWorkerMain,供 --role fsworker) 校验复制、跨卷移动、库根哨兵、增量扫描;FsProxy 把文件操作放进可杀子进程(挂死 → SIGKILL → TIMEOUT)
browser BrowserProvider 合同、createNoneBrowserProvider、camofox 适配骨架、redactBrowserUrl 浏览器服务接口(M1 只有接口与骨架)

测试:deno task test(vitest,外部服务全部用 @umt/testkit 的 mock)。