feat : update
CI / Verify (push) Successful in 1m16s
CI / Build immutable images and deploy (push) Successful in 3m1s

This commit is contained in:
2026-09-06 15:26:08 +07:00 Unverified
parent da734ecdf6
commit de76a27c86
13 changed files with 3906 additions and 22 deletions
+2
View File
@@ -153,6 +153,7 @@ export async function updateGuideBasics(guideId: string, input: unknown) {
...(data.posterArtMediaId !== undefined ? { posterArtMediaId } : {}),
...(data.posterArtOffsetX !== undefined ? { posterArtOffsetX: Math.round(data.posterArtOffsetX) } : {}),
...(data.posterArtOffsetY !== undefined ? { posterArtOffsetY: Math.round(data.posterArtOffsetY) } : {}),
...(data.posterArtScale !== undefined ? { posterArtScale: Math.round(data.posterArtScale) } : {}),
...(data.posterTopColors !== undefined ? { posterTopColors: data.posterTopColors } : {}),
...(data.posterBottomColors !== undefined ? { posterBottomColors: data.posterBottomColors } : {}),
}).where(eq(guides.id, guideId));
@@ -168,6 +169,7 @@ export async function updateGuideBasics(guideId: string, input: unknown) {
mediaId: layer.mediaId,
amount: Math.round(layer.amount),
scale: Math.round(layer.scale),
blendMode: layer.blendMode,
sortOrder,
})));
for (const layer of data.posterBleeding) {
+4 -2
View File
@@ -27,8 +27,10 @@ import {
} from "@/db/schema";
import { getMediaStorage, publicMediaUrl } from "@/lib/media/storage";
import { aliasesByItem } from "@/lib/glossary";
import type { PosterBlendMode } from "@/components/public/material-poster";
const catalogVersionSchema = z.object({ version: z.string() });
const posterBlendModes = new Set(["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"]);
function catalogCharacterWithUrls(
item: typeof catalogCharacters.$inferSelect,
@@ -140,7 +142,7 @@ export async function getGuideByCharacterKey(characterKey: string) {
...row.guide,
coverUrl: publicMediaUrl(row.cover.objectKey),
posterArtUrl: poster[0] ? publicMediaUrl(poster[0].objectKey) : null,
posterBleeding: bleeding.map(({ layer, asset }) => ({ ...layer, imageUrl: asset ? publicMediaUrl(asset.objectKey) : null })),
posterBleeding: bleeding.map(({ layer, asset }) => ({ ...layer, blendMode: (posterBlendModes.has(layer.blendMode) ? layer.blendMode : "multiply") as PosterBlendMode, imageUrl: asset ? publicMediaUrl(asset.objectKey) : null })),
character: catalogCharacterWithUrls(row.character, materialByKey),
sections,
};
@@ -225,7 +227,7 @@ async function getGuideContent(slug: string, publicOnly: boolean) {
...row.guide,
coverUrl: publicMediaUrl(row.cover.objectKey),
posterArtUrl: poster[0] ? publicMediaUrl(poster[0].objectKey) : null,
posterBleeding: bleeding.map(({ layer, asset }) => ({ ...layer, imageUrl: asset ? publicMediaUrl(asset.objectKey) : null })),
posterBleeding: bleeding.map(({ layer, asset }) => ({ ...layer, blendMode: (posterBlendModes.has(layer.blendMode) ? layer.blendMode : "multiply") as PosterBlendMode, imageUrl: asset ? publicMediaUrl(asset.objectKey) : null })),
character: { ...catalogCharacterWithUrls(row.character, materialByKey), aliases: groupedAliases.character.get(row.character.key) ?? [] },
elementIconUrls,
sections,
+2
View File
@@ -39,12 +39,14 @@ export const updateGuideSchema = z.strictObject({
posterArtMediaId: z.string().uuid().nullable().optional(),
posterArtOffsetX: z.number().finite().min(-50).max(50).optional(),
posterArtOffsetY: z.number().finite().min(-50).max(50).optional(),
posterArtScale: z.number().finite().min(50).max(200).optional(),
posterTopColors: z.tuple([z.string().regex(/^#[0-9a-fA-F]{6}$/u), z.string().regex(/^#[0-9a-fA-F]{6}$/u)]).optional(),
posterBottomColors: z.tuple([z.string().regex(/^#[0-9a-fA-F]{6}$/u), z.string().regex(/^#[0-9a-fA-F]{6}$/u)]).optional(),
posterBleeding: z.array(z.strictObject({
mediaId: z.string().uuid(),
amount: z.number().finite().min(0).max(100),
scale: z.number().finite().min(25).max(300),
blendMode: z.enum(["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"]),
})).max(30).optional(),
});