Skip to content

Commit

Permalink
Merge pull request #136 from solaoi/fix_remove-note-with-memo
Browse files Browse the repository at this point in the history
ノート削除時にメモを考慮できていなかったので対応
  • Loading branch information
solaoi authored Apr 12, 2024
2 parents 6acf47f + 084e304 commit 5ba0668
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src-tauri/src/module/deleter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ impl NoteDeleter {
let sqlite = Sqlite::new();
let speeches = sqlite.select_all_speeches_by(note_id).unwrap();
let _ = speeches.iter().for_each(|speech| {
remove_file(&speech.wav).expect("File delete failed");
if speech.wav != "" {
if let Err(e) = remove_file(&speech.wav) {
eprintln!("Failed to delete file {}: {}", &speech.wav, e);
}
}
});

let _ = sqlite.delete_speeches_by(note_id);
Expand Down

0 comments on commit 5ba0668

Please sign in to comment.