From 2ff95c27c5028cb23e9fc035b120cbe52f137c9b Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Sun, 13 Mar 2022 11:39:52 +0000 Subject: [PATCH] OK, ffmpeg needs a file extension --- src/analyse.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/analyse.rs b/src/analyse.rs index 0f4a078..7e1e3f5 100644 --- a/src/analyse.rs +++ b/src/analyse.rs @@ -185,15 +185,21 @@ pub fn analyze_cue_streaming(tracks: Vec,) -> BlissResult { for cue_track in owned_chunk { let audio_path = String::from(cue_track.audio_path.to_string_lossy()); + let ext = cue_track.audio_path.extension(); let track_path = String::from(cue_track.track_path.to_string_lossy()); let mut tmp_file = PathBuf::from(dir.path()); - tmp_file.push(format!("{}.mp3", idx)); + if ext.is_some() { + tmp_file.push(format!("{}.{}", idx, ext.unwrap().to_string_lossy())); + } else { + tmp_file.push(format!("{}.flac", idx)); + } idx += 1; log::debug!("Extracting '{}'", track_path); if cue_track.duration