The Free Software Media System - Server Backend & API
Return string.Empty is span IsEmpty
1hitsong563d5fb5d9c3
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.csindex 05d8f26744..5844db0788 100644--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs@@ -201,11 +201,13 @@ public class LrcLyricProvider : ILyricProviderprivate static string GetMetadataFieldName(string metaDataRow, int index){- return metaDataRow.AsSpan(1, index - 1).Trim().ToString();+ var metadataFieldName = metaDataRow.AsSpan(1, index - 1).Trim();+ return metadataFieldName.IsEmpty ? string.Empty : metadataFieldName.ToString();}private static string GetMetadataValue(string metaDataRow, int index){- return metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim().ToString();+ var metadataValue = metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim();+ return metadataValue.IsEmpty ? string.Empty : metadataValue.ToString();}}diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.csindex 9d4f2f00ed..85f792d098 100644--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs@@ -48,9 +48,9 @@ public class TxtLyricProvider : ILyricProviderLyricLine[] lyricList = new LyricLine[lyricTextLines.Length];- for (int lyricLine = 0; lyricLine < lyricTextLines.Length; lyricLine++)+ for (int lyricLineIndex = 0; lyricLineIndex < lyricTextLines.Length; lyricLineIndex++){- lyricList[lyricLine] = new LyricLine(lyricTextLines[lyricLine]);+ lyricList[lyricLineIndex] = new LyricLine(lyricTextLines[lyricLineIndex]);}return new LyricResponse { Lyrics = lyricList };