Skip to content

Commit 1130e47

Browse files
fix(tts): attach the tts config xml file to relevant job requests
This used to work this way and then got removed I think by mistake
1 parent f4b8aaf commit 1130e47

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/main/windows/Settings/ipcs/register-window-creation.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export function registerSettingsWindowCreationByIPC() {
1010
window: SettingsWindow,
1111

1212
callback(window, event) {
13-
console.log("Window creation callback")
14-
1513
const channel = IPC.WINDOWS.SETTINGS.WHEN_CLOSE
1614

1715
ipcMain.removeHandler(channel)

src/renderer/components/ScriptForm/index.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,32 @@ export function ScriptForm({ job, script }: { job: Job; script: Script }) {
186186
job.jobRequest.options
187187
)
188188
}
189+
// autofill tts config option if present
190+
// if present, it will be an input to the script but an optional one
191+
192+
let ttsConfigOpt = optional.find((o) =>
193+
o.mediaType.includes('application/vnd.pipeline.tts-config+xml')
194+
)
195+
console.log(ttsConfigOpt)
196+
let ttsConfigExists = await App.pathExists(
197+
settings.ttsConfig.xmlFilepath
198+
)
199+
let inputs = [...job.jobRequest.inputs]
200+
if (ttsConfigOpt && ttsConfigExists) {
201+
console.log("TTS XML FILEPATH", settings.ttsConfig.xmlFilepath)
202+
inputs = updateArrayValue(
203+
settings.ttsConfig.xmlFilepath,
204+
ttsConfigOpt,
205+
inputs
206+
)
207+
} else if (!ttsConfigExists) {
208+
App.log(`File does not exist ${settings.ttsConfig.xmlFilepath}`)
209+
}
189210
setSubmitInProgress(true)
190211
App.store.dispatch(
191212
runJob({
192213
...job,
193-
jobRequest: { ...job.jobRequest, options: [...options] },
214+
jobRequest: { ...job.jobRequest, options: [...options], inputs: [...inputs] },
194215
})
195216
)
196217
setSubmitInProgress(false)

0 commit comments

Comments
 (0)