feat(server): 发现页接口——TMDB / 豆瓣 / Bangumi 列表、本地状态、确定匹配记忆
- GET /discover/{tmdb,douban,bangumi},bgm 趋势页在沙箱任务 bangumi.trends 里解析
- 豆瓣 / bgm 每个列表 / 搜索请求走 douban.request / bangumi.request 缓存(TTL 取 storage.cacheTtl),每源限流
- 条目按 TMDB 身份标已订阅 / 媒体库已有 / 下载中;豆瓣 / bgm 条目确定匹配后记在 discover.match
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
e46eb0e3c3
commit
9a154bc249
5 files changed
+576
-27
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// 沙箱任务表(docs/adr/ADR-005-sandbox.md):只放「外部不可信字节 → 结构化数据」的纯函数。
|
||||
// 子进程加载完本表后撤销全部权限(文件 / 网络 / 环境变量 / 子进程),所以任务里不能有任何 I/O;
|
||||
// 输入输出必须能 JSON 化(二进制用 base64)。新增任务:在这里加一项,调用方用 runSandbox(名字, 输入)。
|
||||
import { parseTorrent } from "@umt/adapters";
|
||||
import { parseBangumiBrowser, parseTorrent } from "@umt/adapters";
|
||||
import { decodeSubtitle, detectSubtitleLanguage, subtitleEpisode, subtitleExtOf } from "@umt/domain";
|
||||
import { buildPreview } from "../modules/file-manager/preview-build.ts";
|
||||
import { PAGE_PARSERS, type PageKind } from "../modules/subtitles/online/parse.ts";
|
||||
@@ -121,12 +121,18 @@ function subtitlePage(input: { kind: PageKind; html: string }) {
|
||||
return fn(input.html);
|
||||
}
|
||||
|
||||
/** bgm.tv 动画浏览页(热门趋势,发现页)→ 条目列表 */
|
||||
function bangumiTrends(input: { html: string }) {
|
||||
return parseBangumiBrowser(input.html);
|
||||
}
|
||||
|
||||
export const SANDBOX_JOBS = {
|
||||
"subtitle.parse": subtitleParse,
|
||||
"torrent.parse": torrentParse,
|
||||
"file.preview": buildPreview,
|
||||
"captcha.solve": captchaSolve,
|
||||
"subtitle.page": subtitlePage,
|
||||
"bangumi.trends": bangumiTrends,
|
||||
"self.test": selfTest,
|
||||
} as const;
|
||||
|
||||
|
||||
Reference in new issue
Block a user