mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
Use Span in SupportedMediaTypes comparison
This commit is contained in:
parent
0d5bd85d6d
commit
b1771f07e9
@ -1,6 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using Jellyfin.Extensions;
|
using Jellyfin.Extensions;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Lyrics;
|
namespace MediaBrowser.Controller.Lyrics;
|
||||||
@ -39,9 +38,7 @@ public static class LyricInfo
|
|||||||
|
|
||||||
foreach (var lyricFilePath in Directory.GetFiles(itemDirectoryPath, $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
|
foreach (var lyricFilePath in Directory.GetFiles(itemDirectoryPath, $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
|
||||||
{
|
{
|
||||||
if (lyricFilePath is null) { continue; }
|
if (EnumerableExtensions.Contains(lyricProvider.SupportedMediaTypes, Path.GetExtension(lyricFilePath.AsSpan())[1..], StringComparison.OrdinalIgnoreCase))
|
||||||
|
|
||||||
if (lyricProvider.SupportedMediaTypes.Contains(Path.GetExtension(lyricFilePath)[1..]))
|
|
||||||
{
|
{
|
||||||
return lyricFilePath;
|
return lyricFilePath;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user