diff options
| author | 1hitsong <3330318+1hitsong@users.noreply.github.com> | 2022-09-20 13:34:46 -0400 |
|---|---|---|
| committer | 1hitsong <3330318+1hitsong@users.noreply.github.com> | 2022-09-20 13:34:46 -0400 |
| commit | b1771f07e92dd47f8e49c7f96f61b731d4a6065c (patch) | |
| tree | 8d155fafff4dc44c531e1f168bb543534bc12098 | |
| parent | 0d5bd85d6d292b0876f60bf0654e243f595ec9f9 (diff) | |
Use Span in SupportedMediaTypes comparison
| -rw-r--r-- | MediaBrowser.Controller/Lyrics/LyricInfo.cs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs index 57964eee5..6ebb83d12 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; } |
