Print movie length in human friendly time.
This commit is contained in:
@@ -2,6 +2,7 @@ use std::collections::HashMap;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
|
||||
use human_format::Formatter;
|
||||
use human_format::Scales;
|
||||
@@ -45,7 +46,7 @@ fn print_video_groups(video_groups: &HashMap<PathBuf, Vec<(String, CompactMetada
|
||||
" {:>9} {:>9} {} {}",
|
||||
md.largest_dimension().unwrap(),
|
||||
fmtr.format(md.size as f64),
|
||||
md.duration,
|
||||
humantime::Duration::from(Duration::from_secs(md.duration as u64)),
|
||||
&p[p.rfind("/").unwrap() + 1..]
|
||||
);
|
||||
}
|
||||
@@ -69,7 +70,7 @@ fn print_videos(videos: &HashMap<String, CompactMetadata>, filter: Option<&Regex
|
||||
"{:>9} {:>8} {} {}",
|
||||
md.largest_dimension().unwrap(),
|
||||
fmtr.format(md.size as f64),
|
||||
md.duration,
|
||||
humantime::Duration::from(Duration::from_secs(md.duration as u64)),
|
||||
&name[MOVIE_DIR.len() + 1..]
|
||||
);
|
||||
println!("mv '{}' '{}'", name, TO_BE_REMOVED_DIR);
|
||||
|
||||
Reference in New Issue
Block a user