diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx index b0089d6e..fd27a627 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx @@ -291,14 +291,16 @@ type TaskInputFormProps = { hideTrackPickers?: boolean; }; -const trackLabel = (t: { title: string; lang: string; id: number }) => - t.title || (t.lang && t.lang !== 'und' && t.lang !== 'unknown' ? t.lang.toUpperCase() : '') || `Track ${t.id + 1}`; +const trackLabel = (track: { title: string; lang: string; id: number }) => + track.title || + (track.lang && track.lang !== 'und' && track.lang !== 'unknown' ? track.lang.toUpperCase() : '') || + `Track ${track.id + 1}`; // Channel count → friendly layout name; audio meta → "stereo · aac 193k"-style detail for a track row. const chLabel = (n: number) => n === 1 ? 'mono' : n === 2 ? 'stereo' : n === 6 ? '5.1' : n === 8 ? '7.1' : n ? `${n}ch` : ''; -const audioMeta = (t: AudioTrack) => - [chLabel(t.channels), t.codec].filter(Boolean).join(' ') + (t.bitrate ? ` ${t.bitrate}k` : ''); +const audioMeta = (track: AudioTrack) => + [chLabel(track.channels), track.codec].filter(Boolean).join(' ') + (track.bitrate ? ` ${track.bitrate}k` : ''); // subtitle_edit input: per-subtitle keep flag + editable label, serialized to JSON in the form value. type SubtitleEditEntry = { id: number; keep: boolean; label: string }; @@ -333,14 +335,16 @@ export const TaskInputForm = ({ if (def.type === 'subtitle_edit') { const tracks = subtitleTracks ?? []; const byId = new Map(parseSubtitleSpec(values[key]).map((e) => [e.id, e])); - const entryFor = (t: SubtitleTrack): SubtitleEditEntry => - byId.get(t.id) ?? { id: t.id, keep: true, label: trackLabel(t) }; + const entryFor = (track: SubtitleTrack): SubtitleEditEntry => + byId.get(track.id) ?? { id: track.id, keep: true, label: trackLabel(track) }; const update = (id: number, patch: Partial) => onChange( key, - JSON.stringify(tracks.map((t) => (t.id === id ? { ...entryFor(t), ...patch } : entryFor(t)))), + JSON.stringify( + tracks.map((track) => (track.id === id ? { ...entryFor(track), ...patch } : entryFor(track))), + ), ); - const keptCount = tracks.filter((t) => entryFor(t).keep).length; + const keptCount = tracks.filter((track) => entryFor(track).keep).length; return (
{def.description ?? key} @@ -354,26 +358,26 @@ export const TaskInputForm = ({ ) : ( <>
- {tracks.map((t) => { - const e = entryFor(t); + {tracks.map((track) => { + const e = entryFor(track); return ( -
+
update(t.id, { label: ev.target.value })} + onChange={(ev) => update(track.id, { label: ev.target.value })} className="flex-1 min-w-0 px-2 py-1 text-sm rounded-md border border-duck-dark/15 dark:border-foreground/15 bg-background focus:outline-none focus:ring-1 focus:ring-duck-teal disabled:opacity-40" />
@@ -419,23 +423,23 @@ export const TaskInputForm = ({ None ) : (
- {tracks.map((t) => ( + {tracks.map((track) => (