mirror of https://github.com/jellyfin/jellyfin.git
Remove unneeded 2nd loops
This commit is contained in:
parent
3928d02e17
commit
cecca5f715
|
@ -281,5 +281,3 @@ apiclient/generated
|
||||||
|
|
||||||
# Omnisharp crash logs
|
# Omnisharp crash logs
|
||||||
mono_crash.*.json
|
mono_crash.*.json
|
||||||
|
|
||||||
!LrcParser.dll
|
|
|
@ -40,16 +40,11 @@ namespace Jellyfin.Api.Helpers
|
||||||
ILyricsProvider? newProvider = Activator.CreateInstance(provider) as ILyricsProvider;
|
ILyricsProvider? newProvider = Activator.CreateInstance(provider) as ILyricsProvider;
|
||||||
if (newProvider is not null)
|
if (newProvider is not null)
|
||||||
{
|
{
|
||||||
providerList.Add(newProvider);
|
newProvider.Process(item);
|
||||||
}
|
if (newProvider.HasData)
|
||||||
}
|
{
|
||||||
|
return newProvider.Data;
|
||||||
foreach (ILyricsProvider provider in providerList)
|
}
|
||||||
{
|
|
||||||
provider.Process(item);
|
|
||||||
if (provider.HasData)
|
|
||||||
{
|
|
||||||
return provider.Data;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,26 +81,17 @@ namespace Jellyfin.Api.Helpers
|
||||||
|
|
||||||
if (foundProvider.FileExtensions.Any())
|
if (foundProvider.FileExtensions.Any())
|
||||||
{
|
{
|
||||||
// Gather distinct list of handled file extentions
|
|
||||||
foreach (string lyricFileExtension in foundProvider.FileExtensions)
|
foreach (string lyricFileExtension in foundProvider.FileExtensions)
|
||||||
{
|
{
|
||||||
if (!supportedLyricFileExtensions.Contains(lyricFileExtension))
|
string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
|
||||||
|
if (System.IO.File.Exists(lyricFilePath))
|
||||||
{
|
{
|
||||||
supportedLyricFileExtensions.Add(lyricFileExtension);
|
return lyricFilePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (string lyricFileExtension in supportedLyricFileExtensions)
|
|
||||||
{
|
|
||||||
string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
|
|
||||||
if (System.IO.File.Exists(lyricFilePath))
|
|
||||||
{
|
|
||||||
return lyricFilePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue