Move line break characters to static readonly string array in TxtLyricParser

This commit is contained in:
Niels van Velzen 2023-06-24 09:25:25 +02:00
parent 6de56f0518
commit 1ed5f0a624

View File

@ -12,6 +12,7 @@ namespace MediaBrowser.Providers.Lyric;
public class TxtLyricParser : ILyricParser
{
private static readonly string[] _supportedMediaTypes = { "lrc", "elrc", "txt" };
private static readonly string[] _lineBreakCharacters = { "\r\n", "\r", "\n" };
/// <inheritdoc />
public string Name => "TxtLyricProvider";
@ -30,7 +31,7 @@ public class TxtLyricParser : ILyricParser
return null;
}
string[] lyricTextLines = lyrics.Content.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
string[] lyricTextLines = lyrics.Content.Split(_lineBreakCharacters, StringSplitOptions.None);
if (lyricTextLines.Length == 0)
{