Prioritize local Jellyfin lyrics over LRCLib in prefetch
Some checks failed
CI / build-and-test (push) Has been cancelled

- Check for embedded lyrics in local Jellyfin tracks before fetching from LRCLib
- Remove previously cached LRCLib lyrics when local lyrics are found
- Prevents unnecessary API calls and respects user's embedded lyrics
- Tracks with local lyrics are counted as 'cached' in prefetch stats
This commit is contained in:
2026-02-05 15:09:59 -05:00
parent e0dbd1d4fd
commit 7ff6dbbe7a
2 changed files with 125 additions and 2 deletions

View File

@@ -732,7 +732,9 @@ public class AdminController : ControllerBase
}
}
// Check lyrics status
// Check lyrics status (only from our cache - lrclib/Spotify)
// Note: For local tracks, Jellyfin may have embedded lyrics that we don't check here
// Those will be served directly by Jellyfin when requested
var cacheKey = $"lyrics:{track.PrimaryArtist}:{track.Title}:{track.Album}:{track.DurationMs / 1000}";
var existingLyrics = await _cache.GetStringAsync(cacheKey);
var hasLyrics = !string.IsNullOrEmpty(existingLyrics);