Add ability to change transcription engine from Settings
New features: - Settings > Transcription Engine > "Change Transcription Engine" button stops the sidecar, deletes downloaded files, and reloads the app to show the engine selection screen - Improved SidecarSetup descriptions with detailed explanations of each variant and "Recommended" tag on Cloud (Deepgram) - Cloud option listed first as the recommended choice - New reset_sidecar Tauri command that cleans up sidecar files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,7 @@ pub fn run() {
|
||||
sidecar::get_sidecar_port,
|
||||
sidecar::start_sidecar,
|
||||
sidecar::stop_sidecar,
|
||||
sidecar::reset_sidecar,
|
||||
write_log,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
|
||||
@@ -685,6 +685,42 @@ pub fn stop_sidecar(state: tauri::State<'_, ManagedSidecar>) -> Result<(), Strin
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Stop the running sidecar, delete its files and version marker.
|
||||
/// The next app launch will show the sidecar download prompt.
|
||||
#[tauri::command]
|
||||
pub fn reset_sidecar(state: tauri::State<'_, ManagedSidecar>) -> Result<(), String> {
|
||||
// Stop the running sidecar first
|
||||
{
|
||||
let mut mgr = state
|
||||
.0
|
||||
.lock()
|
||||
.map_err(|e| format!("Lock error: {e}"))?;
|
||||
mgr.stop();
|
||||
}
|
||||
|
||||
let data = data_dir();
|
||||
|
||||
// Delete the version file so check_sidecar returns false
|
||||
let vf = version_file();
|
||||
if vf.exists() {
|
||||
std::fs::remove_file(&vf)
|
||||
.map_err(|e| format!("Failed to delete version file: {e}"))?;
|
||||
}
|
||||
|
||||
// Delete all sidecar directories
|
||||
if let Ok(entries) = std::fs::read_dir(&data) {
|
||||
for entry in entries.flatten() {
|
||||
let name = entry.file_name().to_string_lossy().to_string();
|
||||
if name.starts_with("sidecar-") && entry.path().is_dir() {
|
||||
eprintln!("[sidecar] Removing {}", entry.path().display());
|
||||
let _ = std::fs::remove_dir_all(entry.path());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Tests
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user