diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index bd467d7..ed48ac6 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -2105,5 +2105,34 @@ public class JellyfinController : ControllerBase } #endregion + + #region Spotify Debug + + /// + /// Clear Spotify playlist cache to force re-matching. + /// GET /spotify/clear-cache + /// + [HttpGet("spotify/clear-cache")] + public async Task ClearSpotifyCache() + { + if (!_spotifySettings.Enabled) + { + return BadRequest(new { error = "Spotify Import is not enabled" }); + } + + var cleared = new List(); + + foreach (var playlistName in _spotifySettings.PlaylistNames) + { + var matchedKey = $"spotify:matched:{playlistName}"; + await _cache.DeleteAsync(matchedKey); + cleared.Add(playlistName); + _logger.LogInformation("Cleared cache for {Playlist}", playlistName); + } + + return Ok(new { status = "success", cleared = cleared }); + } + + #endregion } // force rebuild Sun Jan 25 13:22:47 EST 2026