perf/pipeline-improvements #2

Merged
jknapp merged 11 commits from perf/pipeline-improvements into main 2026-03-21 05:29:36 +00:00
3 changed files with 21 additions and 2 deletions
Showing only changes of commit 8e7d21d22b - Show all commits

View File

@@ -91,6 +91,16 @@ pub fn delete_project(id: String, state: State<AppState>) -> Result<(), String>
queries::delete_project(&conn, &id).map_err(|e| e.to_string()) queries::delete_project(&conn, &id).map_err(|e| e.to_string())
} }
#[tauri::command]
pub fn update_segment(
segment_id: String,
new_text: String,
state: State<AppState>,
) -> Result<(), String> {
let conn = state.db.lock().map_err(|e| e.to_string())?;
queries::update_segment_text(&conn, &segment_id, &new_text).map_err(|e| e.to_string())
}
#[tauri::command] #[tauri::command]
pub fn save_project_transcript( pub fn save_project_transcript(
project_id: String, project_id: String,

View File

@@ -11,7 +11,7 @@ use commands::ai::{ai_chat, ai_configure, ai_list_providers};
use commands::export::export_transcript; use commands::export::export_transcript;
use commands::project::{ use commands::project::{
create_project, delete_project, get_project, list_projects, load_project_transcript, create_project, delete_project, get_project, list_projects, load_project_transcript,
save_project_transcript, save_project_transcript, update_segment,
}; };
use commands::settings::{load_settings, save_settings}; use commands::settings::{load_settings, save_settings};
use commands::system::{get_data_dir, llama_list_models, llama_start, llama_status, llama_stop}; use commands::system::{get_data_dir, llama_list_models, llama_start, llama_status, llama_stop};
@@ -40,6 +40,7 @@ pub fn run() {
delete_project, delete_project,
save_project_transcript, save_project_transcript,
load_project_transcript, load_project_transcript,
update_segment,
transcribe_file, transcribe_file,
run_pipeline, run_pipeline,
download_diarize_model, download_diarize_model,

View File

@@ -188,6 +188,14 @@
waveformPlayer?.seekTo(timeMs); waveformPlayer?.seekTo(timeMs);
} }
async function handleTextEdit(segmentId: string, newText: string) {
try {
await invoke('update_segment', { segmentId, newText });
} catch (err) {
console.error('Failed to save segment edit:', err);
}
}
async function handleFileImport() { async function handleFileImport() {
const filePath = await open({ const filePath = await open({
multiple: false, multiple: false,
@@ -512,7 +520,7 @@
<div class="workspace"> <div class="workspace">
<div class="main-content"> <div class="main-content">
<WaveformPlayer bind:this={waveformPlayer} {audioUrl} /> <WaveformPlayer bind:this={waveformPlayer} {audioUrl} />
<TranscriptEditor onWordClick={handleWordClick} /> <TranscriptEditor onWordClick={handleWordClick} onTextEdit={handleTextEdit} />
</div> </div>
<div class="sidebar-right"> <div class="sidebar-right">
<SpeakerManager /> <SpeakerManager />