feat: Phase 1 handover - schema migration, correction mechanism, API fixes
Schema changes: dev.chunks->dev.chunk, remove old_chunk_id/chunk_index Correction: asr-1.json format, generate/apply scripts API: 37/37 endpoints fixed and tested Docs: HANDOVER_V2.0.md for M4
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
use anyhow::{Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::time::Duration;
|
||||
|
||||
use super::executor::PythonExecutor;
|
||||
|
||||
const ASR_TIMEOUT: Duration = Duration::from_secs(1800); // 30 minutes
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct AsrResult {
|
||||
pub language: Option<String>,
|
||||
@@ -36,7 +33,7 @@ pub async fn process_asr(
|
||||
&[video_path, output_path],
|
||||
uuid,
|
||||
"ASR",
|
||||
Some(ASR_TIMEOUT),
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.with_context(|| format!("Failed to run {:?}", script_path))?;
|
||||
|
||||
@@ -247,7 +247,10 @@ impl PythonExecutor {
|
||||
let mut partial_path = out.to_path_buf();
|
||||
partial_path.set_extension("json.partial");
|
||||
let _ = std::fs::rename(tmp, &partial_path);
|
||||
tracing::warn!("[Executor] Partial output preserved: {:?}", partial_path);
|
||||
tracing::warn!(
|
||||
"[Executor] Partial output preserved: {:?}",
|
||||
partial_path
|
||||
);
|
||||
} else {
|
||||
let mut err_path = out.to_path_buf();
|
||||
err_path.set_extension("json.err");
|
||||
|
||||
@@ -131,7 +131,7 @@ fn create_fixed_frame_chunks(
|
||||
let chunk = crate::core::chunk::Chunk::from_yolo_frames(
|
||||
file_id,
|
||||
uuid.to_string(),
|
||||
chunk_index,
|
||||
format!("vis_{}", chunk_index),
|
||||
start_frame,
|
||||
end_frame,
|
||||
fps,
|
||||
@@ -190,7 +190,7 @@ fn create_similarity_based_chunks(
|
||||
let chunk = crate::core::chunk::Chunk::from_yolo_frames(
|
||||
file_id,
|
||||
uuid.to_string(),
|
||||
chunk_index,
|
||||
format!("vis_{}", chunk_index),
|
||||
current_start_frame,
|
||||
end_frame,
|
||||
fps,
|
||||
@@ -214,7 +214,7 @@ fn create_similarity_based_chunks(
|
||||
let chunk = crate::core::chunk::Chunk::from_yolo_frames(
|
||||
file_id,
|
||||
uuid.to_string(),
|
||||
chunk_index,
|
||||
format!("vis_{}", chunk_index),
|
||||
current_start_frame,
|
||||
end_frame,
|
||||
fps,
|
||||
|
||||
Reference in New Issue
Block a user