mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Return string.Empty is span IsEmpty
This commit is contained in:
parent
97409adb45
commit
563d5fb5d9
@ -201,11 +201,13 @@ public class LrcLyricProvider : ILyricProvider
|
|||||||
|
|
||||||
private static string GetMetadataFieldName(string metaDataRow, int index)
|
private 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)
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,9 @@ public class TxtLyricProvider : ILyricProvider
|
|||||||
|
|
||||||
LyricLine[] lyricList = new LyricLine[lyricTextLines.Length];
|
LyricLine[] 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 };
|
return new LyricResponse { Lyrics = lyricList };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user