fix: remove duplicate Spotify playlist interception code with compilation error

This commit is contained in:
2026-01-31 18:07:22 -05:00
parent 18e700d6a4
commit 3137cc4657

View File

@@ -1685,33 +1685,6 @@ public class JellyfinController : ControllerBase
}
}
}
{
// Extract playlist ID from path: playlists/{id}/items
var parts = path.Split('/');
if (parts.Length == 3)
{
var playlistId = parts[1];
_logger.LogInformation("=== SPOTIFY INTERCEPTION === Checking playlist {PlaylistId}", playlistId);
// Get playlist info from Jellyfin to check the name
var playlistInfo = await _proxyService.GetJsonAsync($"Items/{playlistId}", null, Request.Headers);
if (playlistInfo != null && playlistInfo.RootElement.TryGetProperty("Name", out var nameElement))
{
var playlistName = nameElement.GetString() ?? "";
_logger.LogInformation("Playlist name: {PlaylistName}", playlistName);
// Check if this matches any configured Spotify playlists
var matchingConfig = _spotifySettings.Playlists
.FirstOrDefault(p => p.Enabled && p.Name.Equals(playlistName, StringComparison.OrdinalIgnoreCase));
if (matchingConfig != null)
{
_logger.LogInformation("=== INTERCEPTING SPOTIFY PLAYLIST === {PlaylistName}", playlistName);
return await GetSpotifyPlaylistTracksAsync(matchingConfig.SpotifyName);
}
}
}
}
// Handle non-JSON responses (robots.txt, etc.)
if (path.EndsWith(".txt", StringComparison.OrdinalIgnoreCase) ||