Refactor file type checking for better consistency
Fix tests
This commit is contained in:
+2
-20
@@ -183,26 +183,8 @@ pub fn validate_file_types(
|
||||
|
||||
/// Check if a file is a supported media file based on extension
|
||||
fn is_supported_media_file(path: &Path) -> bool {
|
||||
if let Some(ext) = path.extension()
|
||||
&& let Some(ext_str) = ext.to_str() {
|
||||
let ext_lower = ext_str.to_lowercase();
|
||||
return matches!(
|
||||
ext_lower.as_str(),
|
||||
"jpg"
|
||||
| "jpeg"
|
||||
| "png"
|
||||
| "webp"
|
||||
| "tiff"
|
||||
| "tif"
|
||||
| "heif"
|
||||
| "heic"
|
||||
| "avif"
|
||||
| "nef"
|
||||
| "mp4"
|
||||
| "mov"
|
||||
);
|
||||
}
|
||||
false
|
||||
use crate::file_types::is_media_file;
|
||||
is_media_file(path)
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user