Files
youtube-generator/src/engine/rig-block.ts
T
poli0981andClaude Opus 5.5 cefbbd13ee feat(editor): add DLSS 5 neural rendering, more frame generation modes and a custom LUT
Video settings:
- NVIDIA frame generation gains x6 (the multiplier was already in the list
  but offered by no vendor) and Dynamic Multi Frame Generation (DLSS 4.5).
- "Custom…" for every vendor reveals a text field (`frameGenCustom`); the
  description prints what was typed, like a custom graphics preset, and
  nothing for an empty box.
- A "DLSS 5 Neural Rendering" switch (`dlssNeuralRendering`), shown for
  NVIDIA only and printed after the DLSS mode:
  "Ultra - NVIDIA DLSS Quality + NVIDIA DLSS 5 Neural Rendering + NVIDIA
  Dynamic Multi Frame Generation". Another vendor turns it off
  (`coerceDlssNeuralRendering`: the vendor switch, applied profiles and
  templates, backup import).
- Editor store v21 -> v22 back-fills both fields.
- composeGraphicsPart's vendor half moves into small helpers.

My Rig: "Custom" is the LUT field's first suggestion (typing it works too,
any case). The rig block then prints just "LUT applied" in the output
language ("Có áp dụng LUT") instead of "LUT: Custom" — a field's
`customNoteKey`. No migration: the rig is a string map.

i18n: the new editor and description keys in all 8 locales and
_schema.json; brand names stay English. tests/engine/graphics-vendor.test.ts
also holds every vendor's options to their labels in the schema.

Docs: FEATURES (upscaler / frame-gen table, LUT Custom), TECH-SPEC (input
fields, store v22, rig block), CLAUDE.md (how to add an option).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:46:35 +07:00

38 lines
1.4 KiB
TypeScript

import { RIG_FIELDS, formatRigValue, isCustomRigValue } from "@config/rig-fields";
import type { TranslationFn } from "./types";
/**
* The rig as "Label: value" lines, shared by the description and the
* social captions.
*
* Labels come from the output language (`description.rigLabels.*`) and the
* order is {@link RIG_FIELDS}'. Both used to come from the stored object:
* every language printed English keys in capitals ("VIDEO EDITOR:"), in
* whatever order the fields had first been filled in.
*
* v1.6.0: a field with a `customNoteKey` set to "Custom" prints that note
* as its whole line — the LUT's "LUT applied".
*/
export function buildRigLines(
rig: Partial<Record<string, string>> | undefined,
t: TranslationFn,
): string[] {
if (!rig) return [];
const known = new Set(RIG_FIELDS.map((field) => field.id));
const lines = RIG_FIELDS.flatMap((field) => {
const value = formatRigValue(field.id, rig[field.id] ?? "").trim();
if (!value) return [];
if (field.customNoteKey && isCustomRigValue(value)) return [t(field.customNoteKey)];
return [`${t(`description.rigLabels.${field.id}`)}: ${value}`];
});
// Keys that aren't rig fields any more (older versions, hand-edited
// imports) are still printed rather than silently dropped.
for (const [key, raw] of Object.entries(rig)) {
const value = (raw ?? "").trim();
if (!known.has(key) && value) lines.push(`${key.replace(/_/g, " ")}: ${value}`);
}
return lines;
}