Files
home-video-blue-extractinator/src-lib/src/lib.rs
2023-12-27 23:04:54 -05:00

31 lines
745 B
Rust

pub mod video;
use std::path::Path;
pub fn must_analyze(file: &str) -> String {
match analyze(file) {
Ok(result) => result,
Err(msg) => msg,
}
}
pub fn analyze(file: &str) -> Result<String, String> {
eprintln!("analyzing {}", file);
Err(format!("not impl"))
}
pub fn must_clipify(file: &str) -> String {
match clipify(file) {
Ok(result) => result,
Err(msg) => msg,
}
}
pub fn clipify(file: &str) -> Result<String, String> {
eprintln!("clipifying {}", file);
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)),
}
}