From b1771f07e92dd47f8e49c7f96f61b731d4a6065c Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:34:46 -0400 Subject: [PATCH] Use Span in SupportedMediaTypes comparison --- MediaBrowser.Controller/Lyrics/LyricInfo.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs index 57964eee51..6ebb83d125 100644 --- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs +++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs @@ -1,6 +1,5 @@ -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; using Jellyfin.Extensions; namespace MediaBrowser.Controller.Lyrics; @@ -39,9 +38,7 @@ public static class LyricInfo foreach (var lyricFilePath in Directory.GetFiles(itemDirectoryPath, $"{Path.GetFileNameWithoutExtension(itemPath)}.*")) { - if (lyricFilePath is null) { continue; } - - if (lyricProvider.SupportedMediaTypes.Contains(Path.GetExtension(lyricFilePath)[1..])) + if (EnumerableExtensions.Contains(lyricProvider.SupportedMediaTypes, Path.GetExtension(lyricFilePath.AsSpan())[1..], StringComparison.OrdinalIgnoreCase)) { return lyricFilePath; }