A terminal app to allow for easy voice recording
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

update version number and cleaned up some dependecies

CyRav1ck c2de32d9 472077e4

+20 -13
+9 -9
Cargo.toml
··· 1 1 [package] 2 2 name = "TermVoice" 3 - version = "0.1.0" 3 + version = "0.1.1" 4 4 edition = "2024" 5 5 6 6 [[bin]] ··· 8 8 path = "src/main.rs" 9 9 10 10 [dependencies] 11 - cpal = ">=0.15" 12 - mp3lame-encoder = ">=0.2" 13 - rodio = { version = ">=0.17", features = ["symphonia-mp3"] } 14 - ratatui = ">=0.26" 15 - crossterm = ">=0.27" 16 - clap = { version = ">=4", features = ["derive"] } 17 - chrono = ">=0.4" 18 - anyhow = ">=1" 11 + cpal = "^0.17" 12 + mp3lame-encoder = "^0.2" 13 + rodio = { version = "^0.22", features = ["symphonia-mp3"] } 14 + ratatui = "^0.30" 15 + crossterm = "^0.29" 16 + clap = { version = "^4", features = ["derive"] } 17 + chrono = "^0.4" 18 + anyhow = "^1"
+11 -4
src/ui/app.rs
··· 396 396 } else { 397 397 format!("{}.mp3", name) 398 398 }; 399 + if new_name.contains('/') || new_name.contains('\\') || new_name.starts_with("..") { 400 + self.notification = Some("Invalid filename.".into()); 401 + return Ok(()); 402 + } 399 403 let new_path = target.with_file_name(&new_name); 400 - if new_path.exists() { 401 - self.notification = Some(format!("'{}' already exists.", new_name)); 402 - return Ok(()); 404 + match std::fs::rename(&target, &new_path) { 405 + Ok(_) => {} 406 + Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => { 407 + self.notification = Some(format!("'{}' already exists.", new_name)); 408 + return Ok(()); 409 + } 410 + Err(e) => return Err(e.into()), 403 411 } 404 - std::fs::rename(&target, &new_path)?; 405 412 self.notification = Some(format!("Renamed to '{}'.", new_name)); 406 413 self.reload_entries()?; 407 414 self.select_file(&new_path);