diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index 5a2d507..4a5d907 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -1144,12 +1144,17 @@ public class JellyfinController : ControllerBase [HttpGet("Items/{itemId}/Lyrics")] public async Task GetLyrics(string itemId) { + _logger.LogInformation("🎵 GetLyrics called for itemId: {ItemId}", itemId); + if (string.IsNullOrWhiteSpace(itemId)) { return NotFound(); } var (isExternal, provider, externalId) = _localLibraryService.ParseSongId(itemId); + + _logger.LogInformation("🎵 Lyrics request: itemId={ItemId}, isExternal={IsExternal}, provider={Provider}, externalId={ExternalId}", + itemId, isExternal, provider, externalId); // For local tracks, check if Jellyfin already has embedded lyrics if (!isExternal) @@ -1159,13 +1164,16 @@ public class JellyfinController : ControllerBase // Try to get lyrics from Jellyfin first (it reads embedded lyrics from files) var (jellyfinLyrics, statusCode) = await _proxyService.GetJsonAsync($"Audio/{itemId}/Lyrics", null, Request.Headers); + _logger.LogInformation("Jellyfin lyrics check result: statusCode={StatusCode}, hasLyrics={HasLyrics}", + statusCode, jellyfinLyrics != null); + if (jellyfinLyrics != null && statusCode == 200) { _logger.LogInformation("Found embedded lyrics in Jellyfin for track {ItemId}", itemId); return new JsonResult(JsonSerializer.Deserialize(jellyfinLyrics.RootElement.GetRawText())); } - _logger.LogInformation("No embedded lyrics found in Jellyfin, trying Spotify/LRCLIB"); + _logger.LogInformation("No embedded lyrics found in Jellyfin (status: {StatusCode}), trying Spotify/LRCLIB", statusCode); } // Get song metadata for lyrics search