From f509f56304c6f899b88c5ef913f8bf34bd27df51 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Wed, 7 Dec 2022 14:25:16 +0800 Subject: [PATCH] Fix file extension case sensitive issue --- .../Search/ResultManager.cs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index a19d95d0a..4ddc75cfe 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -3,7 +3,6 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin.SharedCommands; using System; using System.Diagnostics; -using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -275,17 +274,17 @@ namespace Flow.Launcher.Plugin.Explorer.Search public static bool IsMedia(string extension) { - return extension is ".jpg" - or ".png" - or ".avi" - or ".mkv" - or ".bmp" - or ".gif" - or ".wmv" - or ".mp3" - or ".flac" - or ".mp4"; + if (string.IsNullOrEmpty(extension)) + { + return false; + } + else + { + return MediaExtensions.Contains(extension.ToLowerInvariant()); + } } + + public static readonly string[] MediaExtensions = { ".jpg", ".png", ".avi", ".mkv", ".bmp", ".gif", ".wmv", ".mp3", ".flac", ".mp4" }; } public enum ResultType