mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
fix: remove duplicate Spotify playlist interception code with compilation error
This commit is contained in:
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user