Skip to content

Commit f509f56

Browse files
Fix file extension case sensitive issue
1 parent fd395c1 commit f509f56

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Flow.Launcher.Plugin.SharedCommands;
44
using System;
55
using System.Diagnostics;
6-
using System.Globalization;
76
using System.IO;
87
using System.Linq;
98
using System.Threading.Tasks;
@@ -275,17 +274,17 @@ internal static Result CreateFileResult(string filePath, Query query, int score
275274

276275
public static bool IsMedia(string extension)
277276
{
278-
return extension is ".jpg"
279-
or ".png"
280-
or ".avi"
281-
or ".mkv"
282-
or ".bmp"
283-
or ".gif"
284-
or ".wmv"
285-
or ".mp3"
286-
or ".flac"
287-
or ".mp4";
277+
if (string.IsNullOrEmpty(extension))
278+
{
279+
return false;
280+
}
281+
else
282+
{
283+
return MediaExtensions.Contains(extension.ToLowerInvariant());
284+
}
288285
}
286+
287+
public static readonly string[] MediaExtensions = { ".jpg", ".png", ".avi", ".mkv", ".bmp", ".gif", ".wmv", ".mp3", ".flac", ".mp4" };
289288
}
290289

291290
public enum ResultType

0 commit comments

Comments
 (0)