diff --git a/Cargo.lock b/Cargo.lock index e059254..909d8bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "n-mb" -version = "1.1.1" +version = "1.1.2" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 496bd98..f834c09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "n-mb" authors = ["Djkáťo "] -version = "1.1.2" +version = "1.1.3" edition = "2021" description = "Simple ffmpeg wrapper to parse files to the most efficient formats within a set size" license = "MIT OR Apache-2.0" diff --git a/src/main.rs b/src/main.rs index 960e552..7a4b3c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -150,13 +150,14 @@ async fn main() -> anyhow::Result<()> { use std::time::Duration; use tokio::time::interval; let commands_ref = commands.clone(); - let mut intv = interval(Duration::from_millis(50)); + let mut intv = interval(Duration::from_millis(10)); command_spawns.push(tokio::spawn(async move { intv.tick().await; 'line: while let Ok(Some(line)) = buff_reader.1.next_line().await { - // dbg!(&line); + #[cfg(debug_assertions)] + dbg!(&line); if let Some(time_start) = line.find("out_time=") { let time: Vec = line[time_start + 10..] .split(':') @@ -169,9 +170,13 @@ async fn main() -> anyhow::Result<()> { if let Ok(number) = part.parse::() { parsed_time.push(number) } else { - break 'line; + // parsed_time.push(0.); + // break 'line; } } + if parsed_time.len() == 0 { + parsed_time.append(&mut vec![0., 0., 0.]); + } let time = parsed_time[0] * 3600. + parsed_time[1] * 60. + parsed_time[2]; let mut command = commands_ref.lock().await; @@ -181,6 +186,8 @@ async fn main() -> anyhow::Result<()> { command.progressed_time = time; } if let Some(progress_i) = line.find("progress=") { + #[cfg(debug_assertions)] + println!("found progress!, {}", &line[progress_i + 9..]); let mut command = commands_ref.lock().await; let command = command.get_mut(buff_reader.0).unwrap();