add is_close function
This commit is contained in:
parent
cd9a4e0a7e
commit
5d607cabe0
@ -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<Format>,
|
||||
audio_streams: Option<Vec<Stream>>,
|
||||
video_streams: Option<Vec<Stream>>,
|
||||
pub format: Option<Format>,
|
||||
pub audio_streams: Option<Vec<Stream>>,
|
||||
pub video_streams: Option<Vec<Stream>>,
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user