Skip to content

Commit

Permalink
refactor(FilePreview): Fix extensions with uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
lgmarchi committed Jan 22, 2024
1 parent 4b94694 commit 68e5985
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ pub const VIDEO_FILE_EXTENSIONS: &[&str] = &[
pub const DOC_EXTENSIONS: &[&str] = &[".doc", ".docx", ".pdf", ".txt"];

pub fn is_video(file_name: &str) -> bool {
VIDEO_FILE_EXTENSIONS.iter().any(|x| file_name.ends_with(x))
VIDEO_FILE_EXTENSIONS
.iter()
.any(|x| file_name.to_lowercase().ends_with(x))
}

pub fn get_images_dir() -> anyhow::Result<PathBuf> {
Expand Down

0 comments on commit 68e5985

Please sign in to comment.