Store lyrics in the database as media streams (#9951)

This commit is contained in:
Cody Robibero
2024-02-26 05:09:40 -07:00
committed by GitHub
parent 59f50ae8b2
commit 0bc41c015f
49 changed files with 1481 additions and 262 deletions

View File

@@ -61,6 +61,11 @@ namespace Jellyfin.Extensions
/// <returns>The part left of the <paramref name="needle" />.</returns>
public static ReadOnlySpan<char> LeftPart(this ReadOnlySpan<char> haystack, char needle)
{
if (haystack.IsEmpty)
{
return ReadOnlySpan<char>.Empty;
}
var pos = haystack.IndexOf(needle);
return pos == -1 ? haystack : haystack[..pos];
}
@@ -73,6 +78,11 @@ namespace Jellyfin.Extensions
/// <returns>The part right of the <paramref name="needle" />.</returns>
public static ReadOnlySpan<char> RightPart(this ReadOnlySpan<char> haystack, char needle)
{
if (haystack.IsEmpty)
{
return ReadOnlySpan<char>.Empty;
}
var pos = haystack.LastIndexOf(needle);
if (pos == -1)
{