tauri aint what i want

This commit is contained in:
Bel LaPointe
2023-12-27 09:43:12 -05:00
parent 62eefeea0f
commit 84b9ac781d
8 changed files with 528 additions and 56 deletions

View File

@@ -1,4 +1,5 @@
pub mod video;
use std::path::Path;
pub fn analyze(file: &str) -> String {
match _analyze(file) {
@@ -21,5 +22,9 @@ pub fn clipify(file: &str) -> String {
fn _clipify(file: &str) -> Result<String, String> {
eprintln!("clipifying {}", file);
Err(format!("not impl"))
let files = video::clipify(&file.to_string())?;
match files.iter().nth(0) {
Some(file) => Ok(Path::new(file).parent().unwrap().to_str().unwrap().to_string()),
None => Err(format!("no clips found from {}", file)),
}
}

View File

@@ -181,7 +181,7 @@ impl Inspection {
.filter(|x| (*x).contains("start: "))
.filter(|x| (*x).contains("bitrate: "))
.nth(0)
.unwrap()
.expect("did not find duration from ffmpeg")
.split(",").nth(0).unwrap()
.split(": ").nth(1).unwrap();
let pieces: Vec<_> = ts.split(":")