chore(content): apply v2 artist adjustments
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m49s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m49s
- 021 (温景然) enName RYAN → KINGSTON
(fixes duplicate: 006 stays RYAN, 021 was a typo)
- 002/003/005/012/014/019/025 now use portraits/{no}-cover.webp
for the cover (chosen from v2 atmospheres per 调整.xlsx). Gallery
remains {no}/{no}-2/{no}-3 as before.
- 036 third atmosphere image is now expected (v2 provides it),
removed MISSING_ATMOSPHERE_3 set.
- tosUrl now appends ?v=2 cache-buster so overwritten TOS files
refresh immediately instead of waiting on CDN/browser cache.
Note: this commit is paired with TOS uploads (handled separately).
This commit is contained in:
parent
7168e50a6e
commit
49be38ff77
@ -324,7 +324,7 @@ export const ARTIST_SEEDS: ArtistSeed[] = [
|
||||
{
|
||||
no: `021`,
|
||||
name: `温景然`,
|
||||
enName: `RYAN`,
|
||||
enName: `KINGSTON`,
|
||||
age: 27,
|
||||
gender: `M`,
|
||||
height: 178,
|
||||
|
||||
@ -14,19 +14,29 @@ import { tosUrl } from "./tos";
|
||||
/** 没有 solo.mp4 的艺人编号(docx 标注"缺视频") */
|
||||
const MISSING_VIDEO: ReadonlySet<string> = new Set(["003", "010", "017", "027"]);
|
||||
|
||||
/** 缺氛围图3 的艺人编号(资料文件夹里实际只到氛围图2) */
|
||||
const MISSING_ATMOSPHERE_3: ReadonlySet<string> = new Set(["036"]);
|
||||
/**
|
||||
* 自定义封面:这些艺人的卡片/详情主立绘改用单独上传的 cover 图,
|
||||
* 而不是默认的氛围图1。氛围图1/2/3 在画廊里保持不变。
|
||||
* (调整.xlsx 里 "封面图用氛围图N" 的实现 —— 新封面已转 webp 上传到
|
||||
* portraits/{no}-cover.webp,这里把 portrait 字段切到该路径。)
|
||||
*/
|
||||
const CUSTOM_COVERS: ReadonlySet<string> = new Set([
|
||||
"002",
|
||||
"003",
|
||||
"005",
|
||||
"012",
|
||||
"014",
|
||||
"019",
|
||||
"025",
|
||||
]);
|
||||
|
||||
/** 画廊 = 三张氛围图(1/2/3)。不包含三视图,因为长宽比与卡片不一致。 */
|
||||
function buildGallery(no: string): string[] {
|
||||
const items = [
|
||||
return [
|
||||
tosUrl(`portraits/${no}.webp`),
|
||||
tosUrl(`portraits/${no}-2.webp`),
|
||||
tosUrl(`portraits/${no}-3.webp`),
|
||||
];
|
||||
if (!MISSING_ATMOSPHERE_3.has(no)) {
|
||||
items.push(tosUrl(`portraits/${no}-3.webp`));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
function buildArtists(): Artist[] {
|
||||
@ -39,7 +49,11 @@ function buildArtists(): Artist[] {
|
||||
age: seed.age,
|
||||
gender: seed.gender,
|
||||
bio: seed.bio,
|
||||
portrait: tosUrl(`portraits/${seed.no}.webp`),
|
||||
portrait: tosUrl(
|
||||
CUSTOM_COVERS.has(seed.no)
|
||||
? `portraits/${seed.no}-cover.webp`
|
||||
: `portraits/${seed.no}.webp`,
|
||||
),
|
||||
avatar: "",
|
||||
gallery: buildGallery(seed.no),
|
||||
videoUrl: MISSING_VIDEO.has(seed.no)
|
||||
|
||||
@ -3,16 +3,21 @@
|
||||
*
|
||||
* 用法:
|
||||
* tosUrl("portraits/001.webp")
|
||||
* → https://cyberstar.tos-cn-shanghai.volces.com/cyber-star/portraits/001.webp
|
||||
* → https://cyberstar.tos-cn-shanghai.volces.com/cyber-star/portraits/001.webp?v=2
|
||||
*
|
||||
* 环境变量 NEXT_PUBLIC_TOS_DOMAIN 配置:
|
||||
* .env.local / .env.production → 完整的桶 + 路径前缀 (含 scheme, 不含末尾 /)
|
||||
* 未设置时 fallback 到相对路径 (/path/...), 适合本地用 public/ 静态文件托管的场景。
|
||||
*
|
||||
* 缓存版本号 TOS_VERSION:每次有 TOS 文件被原地覆盖更新(图片/视频),
|
||||
* 把这个数字 +1。浏览器和 CDN 会把带新版本号的 URL 当作全新资源,
|
||||
* 立即看到更新后的内容,不必等 TTL 过期或手动 invalidate。
|
||||
*/
|
||||
const TOS_BASE = (process.env.NEXT_PUBLIC_TOS_DOMAIN ?? "").replace(/\/+$/, "");
|
||||
const TOS_VERSION = "2";
|
||||
|
||||
export function tosUrl(path: string): string {
|
||||
const clean = path.replace(/^\/+/, "");
|
||||
if (!TOS_BASE) return `/${clean}`;
|
||||
return `${TOS_BASE}/${clean}`;
|
||||
const base = TOS_BASE ? `${TOS_BASE}/${clean}` : `/${clean}`;
|
||||
return `${base}?v=${TOS_VERSION}`;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user