mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 07:58:39 -05:00
Fix unsynced lyrics displaying as one big line
When LRClib returns plain/unsynced lyrics, they contain newlines but were being sent as a single text block. Jellyfin clients would display them all on one line. Now splits plain lyrics by newlines and sends each line separately, so they display properly line-by-line in the client. LRClib search URL format: https://lrclib.net/api/get\?track_name\=\{track\}\&artist_name\=\{artist\}\&album_name\=\{album\}\&duration\=\{seconds\}
This commit is contained in:
@@ -1062,13 +1062,26 @@ public class JellyfinController : ControllerBase
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(lyricsText))
|
||||
{
|
||||
// Plain lyrics - split by newlines and return each line separately
|
||||
var lines = lyricsText.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var line in lines)
|
||||
{
|
||||
lyricLines.Add(new
|
||||
{
|
||||
Start = (long?)null,
|
||||
Text = line.Trim()
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Plain lyrics - return as single block
|
||||
// No lyrics at all
|
||||
lyricLines.Add(new
|
||||
{
|
||||
Start = (long?)null,
|
||||
Text = lyricsText
|
||||
Text = ""
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user