Merge branch 'main' into copy/c6
This commit is contained in:
commit
8a9cbaff6a
146 files changed
+949
-577
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { join } from "node:path";
|
||||
import { simplifiedChineseTagline } from "@umt/adapters";
|
||||
import {
|
||||
type AcquisitionPlan,
|
||||
type AcquisitionSlot,
|
||||
@@ -405,6 +406,7 @@ export function registerLibraryRoutes(app: ModuleApp, d: AoDeps) {
|
||||
finishedAt: r.finished_at ? new Date(r.finished_at).toISOString() : null,
|
||||
})),
|
||||
scrape: await latestEntityScrape(d, id),
|
||||
displayTagline: heroTagline(e!.metadata),
|
||||
};
|
||||
return detail;
|
||||
},
|
||||
@@ -642,3 +644,11 @@ export function registerLibraryRoutes(app: ModuleApp, d: AoDeps) {
|
||||
{ tag: TAG },
|
||||
);
|
||||
}
|
||||
|
||||
/** 详情页头部的标语:只显示简体中文(见 simplifiedChineseTagline);存储的标语与语言不变 */
|
||||
function heroTagline(metadata: unknown): string | null {
|
||||
const m = (metadata ?? {}) as Record<string, { value?: unknown; language?: string | null } | undefined>;
|
||||
const text = typeof m.tagline?.value === "string" ? m.tagline.value : null;
|
||||
const orig = typeof m.originalLanguage?.value === "string" ? m.originalLanguage.value : null;
|
||||
return simplifiedChineseTagline(text, m.tagline?.language ?? null, orig);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
fetchRichDetail,
|
||||
fetchRichSeason,
|
||||
type MetadataCandidate,
|
||||
simplifiedChineseTagline,
|
||||
TmdbError,
|
||||
type TmdbRichDetail,
|
||||
} from "@umt/adapters";
|
||||
@@ -453,7 +454,7 @@ export function registerSearchRoutes(app: ModuleApp, ctx: ServerContext, d: Sear
|
||||
out.title = rich.title || out.title;
|
||||
out.overview = rich.overview ?? out.overview;
|
||||
out.titleZh = rich.titleZh;
|
||||
out.tagline = rich.tagline;
|
||||
out.tagline = simplifiedChineseTagline(rich.tagline, rich.taglineLanguage, rich.originalLanguage);
|
||||
out.genres = rich.genres;
|
||||
out.voteAverage = rich.voteAverage;
|
||||
out.voteCount = rich.voteCount;
|
||||
|
||||
Reference in new issue
Block a user