fix(scrape): 没有 TMDB id 的作品季 / 集缺元数据时照旧写占位 NFO
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
5b023ad682
commit
871031d5ed
4 files changed
+23
-7
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { readFile, stat, utimes, writeFile } from "node:fs/promises";
|
||||
import { mkdir, readFile, stat, utimes, writeFile } from "node:fs/promises";
|
||||
import type { TmdbRichSeasonDetail } from "@umt/adapters";
|
||||
import type { ScrapeFileResult, ScrapeMatch } from "@umt/contracts";
|
||||
import { createTempTree, type TempTree } from "@umt/testkit";
|
||||
@@ -295,6 +295,19 @@ describe.skipIf(!hasPg)("刮削准确度:更新模式、缺元数据不写占位
|
||||
expect(r2.status).toBe("partial");
|
||||
});
|
||||
|
||||
it("没有 TMDB id 的作品(Local)季 / 集缺元数据时照旧写占位", async () => {
|
||||
const local = await entity("series", "本地剧", { title: f("本地剧") });
|
||||
const dir = "TV/本地剧 (2020)";
|
||||
await mkdir(lib.path(`${dir}/Season 1`), { recursive: true });
|
||||
await writeFile(lib.path(`${dir}/Season 1/Local.S01E01.mkv`), "video");
|
||||
const calls = seasonCalls.length;
|
||||
const r = await scrape(local, "tv", dir, "update", null);
|
||||
expect(seasonCalls.length).toBe(calls);
|
||||
expect(r.files.find((x) => x.path.endsWith("S01E01.nfo"))).toMatchObject({ action: "written" });
|
||||
expect(await readFile(lib.path(`${dir}/Season 1/Local.S01E01.nfo`), "utf8")).toContain("第 1 集");
|
||||
expect(r.files.some((x) => x.reason === "scrape_metadata_missing")).toBe(false);
|
||||
});
|
||||
|
||||
it("合集 / 其他类作品按电影刮削,NFO 根元素是 <movie>", async () => {
|
||||
expect(nfoWork({ kind: "collection", title: "x", original_title: null, year: null, metadata: {} }, {}).kind).toBe(
|
||||
"movie",
|
||||
|
||||
Reference in new issue
Block a user