diff options
| author | Niels van Velzen <git@ndat.nl> | 2023-06-24 09:25:25 +0200 |
|---|---|---|
| committer | Niels van Velzen <git@ndat.nl> | 2023-06-24 09:25:25 +0200 |
| commit | 1ed5f0a624abeebef16a960ed7a52942bce47502 (patch) | |
| tree | 8d6240780c66dc1b4ec3b10d4df286ffef9350ed | |
| parent | 6de56f05186b77042a611112d82208b8fa8675fb (diff) | |
Move line break characters to static readonly string array in TxtLyricParser
| -rw-r--r-- | MediaBrowser.Providers/Lyric/TxtLyricParser.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricParser.cs b/MediaBrowser.Providers/Lyric/TxtLyricParser.cs index 2ed0a6d8a..7e029ee42 100644 --- a/MediaBrowser.Providers/Lyric/TxtLyricParser.cs +++ b/MediaBrowser.Providers/Lyric/TxtLyricParser.cs @@ -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) { |
