diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 57276a04..3192d615 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -15,14 +15,14 @@ mod playlist; pub use arg_parse::get_args; pub use config::{get_config, Config}; // pub use folder::walk; -pub use json_reader::read_json; +pub use json_reader::{read_json, Program}; pub use playlist::program; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct MediaProbe { - format: Option, - audio_streams: Option>, - video_streams: Option>, + pub format: Option, + pub audio_streams: Option>, + pub video_streams: Option>, } impl MediaProbe { @@ -118,3 +118,11 @@ pub fn sec_to_time(sec: f64) -> String { date_time.format("%H:%M:%S").to_string() } + +pub fn is_close(a: f64, b: f64, to: f64) -> bool { + if (a - b).abs() > to { + return true + } + + false +}