Make ProjectFile struct support both v1 and v2 formats
Some checks failed
Release / Bump version and tag (push) Successful in 3s
Release / Build App (macOS) (push) Successful in 1m20s
Release / Build App (Linux) (push) Has been cancelled
Release / Build App (Windows) (push) Has been cancelled

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:
Claude
2026-03-23 09:48:27 -07:00
parent fee1255cac
commit e05f88eecf

View File

@@ -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>,