Fix lyrics fetching and disable prefetching

- Fix LyricsPrefetchService to use server API key for Jellyfin lyrics checks
- Remove Spotify lyrics caching (local Docker container is fast)
- Disable lyrics prefetching service (not needed - Jellyfin/Spotify are fast)
- Add POST /api/admin/cache/clear-lyrics endpoint to clear LRCLIB cache
- Only LRCLIB lyrics are cached now (external API)
This commit is contained in:
2026-02-06 23:48:18 -05:00
parent 64e2004bdc
commit b99a199ef3
4 changed files with 33 additions and 18 deletions

View File

@@ -1738,6 +1738,30 @@ public class AdminController : ControllerBase
});
}
/// <summary>
/// Clear all cached lyrics (LRCLIB only - Jellyfin and Spotify lyrics are not cached)
/// </summary>
[HttpPost("cache/clear-lyrics")]
public async Task<IActionResult> ClearLyricsCache()
{
_logger.LogInformation("Lyrics cache clear requested from admin UI");
var clearedRedisKeys = 0;
// Clear all lyrics cache keys (pattern-based deletion)
// This includes LRCLIB lyrics and manual mappings
var lyricsKeysDeleted = await _cache.DeleteByPatternAsync("lyrics:*");
clearedRedisKeys += lyricsKeysDeleted;
_logger.LogInformation("Lyrics cache cleared: {RedisKeys} Redis keys deleted", clearedRedisKeys);
return Ok(new {
message = "Lyrics cache cleared successfully",
redisKeysDeleted = clearedRedisKeys,
note = "Only LRCLIB lyrics are cached. Jellyfin and Spotify lyrics are fetched on-demand (fast)."
});
}
/// <summary>
/// Restart the allstarr container to apply configuration changes
/// </summary>