mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Clarify lyrics preference: synced lyrics preferred over plain
Already working correctly, just made the code clearer with explicit variable
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user