feat: export clips, protect bookmarks and clean session storage
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
//! Validation/repair helper: sessions-dir session-id start-ms end-ms output.mp4.
|
||||
use std::{path::PathBuf, time::Duration};
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let args: Vec<_> = std::env::args().skip(1).collect();
|
||||
if args.len() != 5 {
|
||||
return Err("Usage: export sessions-dir session-id start-ms end-ms output.mp4".into());
|
||||
}
|
||||
let store = clipbin_core::store::Store {
|
||||
root: PathBuf::from(&args[0]),
|
||||
};
|
||||
let metadata = store.metadata(args[1].parse()?)?;
|
||||
let (start, end) = metadata.export_range(
|
||||
Duration::from_millis(args[2].parse()?),
|
||||
Duration::from_millis(args[3].parse()?),
|
||||
);
|
||||
clipbin_media::export::export(&metadata, start, end, false, &PathBuf::from(&args[4]))?;
|
||||
println!(
|
||||
"Exported {} – {}",
|
||||
clipbin_core::library::format_clock(start),
|
||||
clipbin_core::library::format_clock(end)
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user