From 7f9e2549a2ea0c2737c00ba54fd005fd07b5eddb Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 6 Mar 2021 09:49:47 +0100 Subject: [PATCH] Fix weak check --- src/utils/mp3_utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/mp3_utils.rs b/src/utils/mp3_utils.rs index f6f93b5..e1e9c85 100644 --- a/src/utils/mp3_utils.rs +++ b/src/utils/mp3_utils.rs @@ -7,7 +7,7 @@ pub fn is_valid_mp3(file: &[u8]) -> bool { let res = mp3_metadata::read_from_slice(file); match res { - Ok(_) => true, + Ok(e) => e.duration.as_secs() > 0, Err(e) => { eprintln!("Error while parsing MP3 file ! {:#?}", e); false