Clarify lyrics preference: synced lyrics preferred over plain

Already working correctly, just made the code clearer with explicit variable
This commit is contained in:
2026-01-30 02:28:05 -05:00
parent 34bfc20d28
commit 680454e76e

View File

@@ -1002,7 +1002,13 @@ public class JellyfinController : ControllerBase
return NotFound(new { error = "Lyrics not found" }); return NotFound(new { error = "Lyrics not found" });
} }
// Prefer synced lyrics, fall back to plain
var lyricsText = lyrics.SyncedLyrics ?? lyrics.PlainLyrics ?? "";
var isSynced = !string.IsNullOrEmpty(lyrics.SyncedLyrics);
// Return in Jellyfin lyrics format // Return in Jellyfin lyrics format
// For synced lyrics, return the LRC format directly
// For plain lyrics, return as a single block
var response = new var response = new
{ {
Metadata = new Metadata = new
@@ -1011,14 +1017,14 @@ public class JellyfinController : ControllerBase
Album = lyrics.AlbumName, Album = lyrics.AlbumName,
Title = lyrics.TrackName, Title = lyrics.TrackName,
Length = lyrics.Duration, Length = lyrics.Duration,
IsSynced = !string.IsNullOrEmpty(lyrics.SyncedLyrics) IsSynced = isSynced
}, },
Lyrics = new[] Lyrics = new[]
{ {
new new
{ {
Start = (long?)null, Start = (long?)null,
Text = lyrics.SyncedLyrics ?? lyrics.PlainLyrics ?? "" Text = lyricsText
} }
} }
}; };