mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-23 10:30:41 +00:00
Lowercase extension before detemining media type (#437)
This commit is contained in:
parent
e77e4d86e8
commit
716c58cb71
1 changed files with 2 additions and 1 deletions
|
@ -57,11 +57,12 @@ impl Media {
|
|||
}
|
||||
|
||||
pub fn category(&self) -> MediaCategory {
|
||||
match self
|
||||
match &*self
|
||||
.file_path
|
||||
.rsplitn(2, '.')
|
||||
.next()
|
||||
.expect("Media::category: extension error")
|
||||
.to_lowercase()
|
||||
{
|
||||
"png" | "jpg" | "jpeg" | "gif" | "svg" => MediaCategory::Image,
|
||||
"mp3" | "wav" | "flac" => MediaCategory::Audio,
|
||||
|
|
Loading…
Reference in a new issue