From 9530e1dafc480bb5af833f354dd44444c31cd00d Mon Sep 17 00:00:00 2001 From: pancakes Date: Wed, 26 Feb 2025 18:16:30 +1000 Subject: [PATCH] [frontend/components] Fallback to detecting drive file type by filename extension --- Iceshrimp.Frontend/Components/DriveEntry.razor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Iceshrimp.Frontend/Components/DriveEntry.razor b/Iceshrimp.Frontend/Components/DriveEntry.razor index 4d8705d2..f4d7d1ae 100644 --- a/Iceshrimp.Frontend/Components/DriveEntry.razor +++ b/Iceshrimp.Frontend/Components/DriveEntry.razor @@ -35,15 +35,15 @@ } - @if (File.ContentType.StartsWith("image")) + @if (File.ContentType.StartsWith("image") || Constants.CommonImageExtensions.Any(e => File.Filename.EndsWith(e))) { @File.Description } - else if (File.ContentType.StartsWith("audio")) + else if (File.ContentType.StartsWith("audio") || Constants.CommonAudioExtensions.Any(e => File.Filename.EndsWith(e))) { } - else if (File.ContentType.StartsWith("video")) + else if (File.ContentType.StartsWith("video") || Constants.CommonVideoExtensions.Any(e => File.Filename.EndsWith(e))) { }