play listing uploads the hi-res icon (and the feature graphic) for a new Play language in the same edit (403 no high resolution icon set; play images skipped it), pitfall 102; script traces skip test files

This commit is contained in:
CRTkafa 2026-10-22 03:33:30 +08:00
parent 256e8e33ad
commit 600b6893e5
6 changed files with 47 additions and 1 deletions

View file

@ -72,6 +72,18 @@ export function missingChange(type: string, remote: number, prune: boolean): Ima
/** What one language uploads: the sets with files, the optional types without, and errors (missing required sets). */
export interface LangImages { sets: [string, string[]][]; missing: string[]; errors: string[] }
/** The graphics a NEW Play language needs before its edit can commit (403 "no high resolution icon set for language"):
* the hi-res icon and, when rendered, the feature graphic. `play listing` uploads them in the same edit as the text,
* so listing and images never wait for each other (pitfall 102). */
export function firstGraphics(ctx: Ctx, code: string): [string, string][] {
const { config, resolve } = ctx.loaded;
const icon = resolve(config.play?.icon ?? join(config.icons?.out ?? 'store/icons', 'play-512.png'));
const l = byPlayCode(config.languages).get(code);
const src = resolve(config.renders ?? config.shots?.out ?? 'store/renders');
const li = langImages(code, l ? join(src, l.id) : join(src, '__none__'), icon, false);
return li.sets.filter(([t]) => t === 'icon' || t === 'featureGraphic').map(([t, files]) => [t, files[0]!] as [string, string]);
}
/** The image sets of one language folder (`tablets` = resolved play.tablets). Reads the folder only. */
export function langImages(code: string, dir: string, icon: string, tablets: boolean): LangImages {
const out: LangImages = { sets: [], missing: [], errors: [] };