Merge branch 'main' into copy/c6
This commit is contained in:
commit
8a9cbaff6a
146 files changed
+949
-577
No files matched your search
@@ -336,4 +336,32 @@ describe.skipIf(!hasPg)("LIBV-1 入库版本", () => {
|
||||
expect(response.body.data.downloads).toHaveLength(105);
|
||||
expect(response.body.data.droppedPlans).toHaveLength(51);
|
||||
});
|
||||
|
||||
it("作品详情头部标语只给简体中文(displayTagline);存储的 metadata.tagline 不变", async () => {
|
||||
const field = (value: unknown, language: string | null = null) => ({
|
||||
value,
|
||||
source: "tmdb",
|
||||
language,
|
||||
at: "2026-10-01T00:00:00.000Z",
|
||||
locked: false,
|
||||
});
|
||||
const cases: [string, string, string | null][] = [
|
||||
["我们注定要离开地球", "en", "我们注定要离开地球"],
|
||||
["我們註定要離開地球", "en", null],
|
||||
["Mankind was born on Earth.", "en", null],
|
||||
["我們註定要離開地球", "zh", "我們註定要離開地球"],
|
||||
];
|
||||
for (const [tagline, orig, want] of cases) {
|
||||
const entityId = await seedEntity(h.db, { kind: "movie", title: `标语 ${tagline}`, year: 2026 });
|
||||
await h.db
|
||||
.updateTable("media_entity")
|
||||
.set({ metadata: JSON.stringify({ tagline: field(tagline), originalLanguage: field(orig) }) })
|
||||
.where("id", "=", entityId)
|
||||
.execute();
|
||||
const r = await h.api("GET", `/library/${entityId}`);
|
||||
expect(r.status).toBe(200);
|
||||
expect(r.body.data.displayTagline).toBe(want);
|
||||
expect(r.body.data.entity.metadata.tagline.value).toBe(tagline);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -33,6 +33,7 @@ function detail(
|
||||
overview: null,
|
||||
overviewLanguage: null,
|
||||
tagline: null,
|
||||
taglineLanguage: null,
|
||||
year: null,
|
||||
releaseDate: null,
|
||||
lastAirDate: null,
|
||||
|
||||
@@ -68,6 +68,7 @@ const detail = (entityType: "movie" | "tv", externalId: string): TmdbRichDetail
|
||||
overview: null,
|
||||
overviewLanguage: null,
|
||||
tagline: null,
|
||||
taglineLanguage: null,
|
||||
year: 2022,
|
||||
releaseDate: null,
|
||||
lastAirDate: null,
|
||||
|
||||
Reference in new issue
Block a user