Refactor file type checking for better consistency

Fix tests
This commit is contained in:
Cameron
2025-12-23 22:30:53 -05:00
parent 6dbac6f22f
commit 636701a69e
7 changed files with 170 additions and 132 deletions
+2 -20
View File
@@ -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)]