fix(commandRouter): rewire audio invokes to actual v2 command names

cmdUpdateAudioSettings was invoking four v2 commands that do not exist:
- v2_set_audio_backend       -> v2_set_audio_backend_type
- v2_set_audio_device        -> v2_set_audio_output_device
- v2_set_exclusive_mode      -> v2_set_audio_exclusive_mode
- v2_set_dac_passthrough     -> v2_set_audio_dac_passthrough

Also corrects the parameter for set_audio_output_device, which expects
'device' (not 'deviceName'). The other three already use the correct
parameter names. The function currently has no callers, but keeping the
shape correct prevents a future caller from hitting silent failures.

cc
This commit is contained in:
vicrodh committed 2026-04-25 18:23:01 -06:00
1 parent 404296f49f
commit 4f0e4e6c81
1 file changed
+4 -4
+4 -4
View File
@@ -246,10 +246,10 @@ export async function cmdUpdateAudioSettings(patch: Record<string, unknown>): Pr
return remotePost('/api/audio/settings', patch);
} else {
// Local: individual invoke calls per field
if ('backend_type' in patch) await invoke('v2_set_audio_backend', { backendType: patch.backend_type });
if ('output_device' in patch) await invoke('v2_set_audio_device', { deviceName: patch.output_device });
if ('exclusive_mode' in patch) await invoke('v2_set_exclusive_mode', { enabled: patch.exclusive_mode });
if ('dac_passthrough' in patch) await invoke('v2_set_dac_passthrough', { enabled: patch.dac_passthrough });
if ('backend_type' in patch) await invoke('v2_set_audio_backend_type', { backendType: patch.backend_type });
if ('output_device' in patch) await invoke('v2_set_audio_output_device', { device: patch.output_device });
if ('exclusive_mode' in patch) await invoke('v2_set_audio_exclusive_mode', { enabled: patch.exclusive_mode });
if ('dac_passthrough' in patch) await invoke('v2_set_audio_dac_passthrough', { enabled: patch.dac_passthrough });
return invoke('v2_get_audio_settings');
}
}