Make ProjectFile struct support both v1 and v2 formats
audio_file, source_file, audio_wav are all optional with serde defaults. v1 projects have audio_file, v2 projects have source_file + audio_wav. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,12 @@ use crate::state::AppState;
|
|||||||
pub struct ProjectFile {
|
pub struct ProjectFile {
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub audio_file: String,
|
#[serde(default)]
|
||||||
|
pub audio_file: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub source_file: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub audio_wav: Option<String>,
|
||||||
pub created_at: String,
|
pub created_at: String,
|
||||||
pub segments: Vec<ProjectFileSegment>,
|
pub segments: Vec<ProjectFileSegment>,
|
||||||
pub speakers: Vec<ProjectFileSpeaker>,
|
pub speakers: Vec<ProjectFileSpeaker>,
|
||||||
|
|||||||
Reference in New Issue
Block a user