mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2025-04-08 05:00:02 +03:00
Simplify
This commit is contained in:
parent
2ff95c27c5
commit
cf729aaef3
@ -196,27 +196,15 @@ pub fn analyze_cue_streaming(tracks: Vec<cue::CueTrack>,) -> BlissResult<Receive
|
||||
idx += 1;
|
||||
|
||||
log::debug!("Extracting '{}'", track_path);
|
||||
if cue_track.duration<last_track_duration {
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
|
||||
.arg("-ss").arg(&cue_track.start.hhmmss())
|
||||
.arg("-t").arg(&cue_track.duration.hhmmss())
|
||||
.arg("-c").arg("copy")
|
||||
.arg(String::from(tmp_file.to_string_lossy()))
|
||||
.stderr(NullFile)
|
||||
.join() {
|
||||
Ok(_) => { },
|
||||
Err(e) => { log::error!("Failed to call ffmpeg. {}", e); }
|
||||
}
|
||||
} else {
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
|
||||
.arg("-ss").arg(&cue_track.start.hhmmss())
|
||||
.arg("-c").arg("copy")
|
||||
.arg(String::from(tmp_file.to_string_lossy()))
|
||||
.stderr(NullFile)
|
||||
.join() {
|
||||
Ok(_) => { },
|
||||
Err(e) => { log::error!("Failed to call ffmpeg. {}", e); }
|
||||
}
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
|
||||
.arg("-ss").arg(&cue_track.start.hhmmss())
|
||||
.arg("-t").arg(&cue_track.duration.hhmmss())
|
||||
.arg("-c").arg("copy")
|
||||
.arg(String::from(tmp_file.to_string_lossy()))
|
||||
.stderr(NullFile)
|
||||
.join() {
|
||||
Ok(_) => { },
|
||||
Err(e) => { log::error!("Failed to call ffmpeg. {}", e); }
|
||||
}
|
||||
|
||||
if ! cfg!(windows) {
|
||||
|
@ -13,7 +13,7 @@ use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
|
||||
pub const MARKER:&str = ".CUE_TRACK.";
|
||||
pub const LAST_TRACK_DURATION:u64 = 60*60*24*7;
|
||||
pub const LAST_TRACK_DURATION:u64 = 60*60*24;
|
||||
const GENRE:&str = "GENRE";
|
||||
|
||||
#[derive(Clone)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user