rootandClaude Fable 5.1 ef2e504a94 feat(adapters): qBittorrent, filesystem, TMDB and Emby adapters with testkit mocks (W1-3a)
- qbittorrent: WebUI API v2 client (cookie/API-key auth, add/info/files/filePrio,
  pause/resume with 5.x stop/start fallback, tags, delete with explicit deleteFiles,
  maindata), error classes, idempotent submit with local infohash (own bencode)
  and post-timeout hash/probe-tag lookup; state mapping per MoviePilot
- fs: copyWithVerify (tmp + fsync + size/sha256/sample + no-clobber commit),
  moveSafe (EXDEV surfaced), resumable crossDeviceMove, statSafe/checkRoot with
  root sentinel, budgeted incremental scan with cursor, ffprobe, statfs usage
- tmdb: multi-language search/details/seasons, LRU+TTL cache with coalescing,
  rate-limit backoff, MoviePilot match chain (name normalization, year +-1)
- emby: Emby/Jellyfin items/seasons/episodes/MediaSources, failures -> unknown
- testkit: mock qB / TMDB / Emby servers, torrent builder, temp-tree fixtures
- docs: W1-3a porting table appended to downloader-and-sites ledger

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-27 18:07:48 +08:00

UHD Media Tool

内部使用、Agent 自动化优先的媒体整理入库平台。需求基线见 media_automation_requirements_architecture_v0.7.md,v0.1 工程任务书见 docs/plan/00-first-version-plan.md。

快速启动

cp .env.example .env
pnpm db:up          # postgres:16-alpine,端口 55433
pnpm install
pnpm db:migrate
pnpm dev            # API http://localhost:4380  控制台 http://localhost:5180

提交前:pnpm run ci(typecheck + lint + test + check:tokens + build)。注意不要用 pnpm ci,它在 pnpm 11 是内置的 clean-install。

更多见 docs/runbook/dev.md。

仓库结构

路径 职责
apps/web React Router 7 SPA 控制台,沿用 uhd_web 设计系统
apps/server Hono API(/api/v1)+ SSE + worker 入口
packages/contracts zod schema:API/事件/能力的唯一定义
packages/db Kysely 客户端、表类型与迁移
packages/domain 纯业务逻辑,无 IO
packages/adapters qB / RSS / 站点 / TMDB / Emby / 文件系统适配
packages/tasks 持久任务与 outbox
packages/agent Pi 接入与能力注册桥接
packages/testkit mock 服务与测试夹具
docs/adr 架构决策记录
docs/design 设计系统规范
docs/runbook 运行手册
spikes/ 独立兼容性验证(不属于 workspace)

技术选型:Node.js 24 + pnpm workspace + TypeScript 5.9 strict(偏离 REQ 的 Deno 方向,原因见 ADR-001)。

S
Description
No description provided
Readme
8.6 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 97.9%
JavaScript 0.8%
CSS 0.5%
Python 0.5%
Shell 0.2%