mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 16:08:39 -05:00
Fix Spotify playlist track counts in client responses
- Fixed UpdateSpotifyPlaylistCounts to use GetPlaylistByJellyfinId instead of GetPlaylistById - Fixed GetSpotifyPlaylistTracksOrderedAsync to use correct playlist config lookup - Added diagnostic logging for playlist config lookups - Removed test-websocket.html file This fixes the issue where Spotify playlists showed 0 tracks in playlist lists but worked correctly when accessed directly.
This commit is contained in:
@@ -2767,10 +2767,12 @@ public class JellyfinController : ControllerBase
|
||||
_logger.LogInformation("Found Spotify playlist: {Id}", playlistId);
|
||||
|
||||
// This is a Spotify playlist - get the actual track count
|
||||
var playlistConfig = _spotifySettings.GetPlaylistById(playlistId);
|
||||
var playlistConfig = _spotifySettings.GetPlaylistByJellyfinId(playlistId);
|
||||
|
||||
if (playlistConfig != null)
|
||||
{
|
||||
_logger.LogInformation("Found playlist config for Jellyfin ID {JellyfinId}: {Name} (Spotify ID: {SpotifyId})",
|
||||
playlistId, playlistConfig.Name, playlistConfig.Id);
|
||||
var playlistName = playlistConfig.Name;
|
||||
|
||||
// Get matched external tracks (tracks that were successfully downloaded/matched)
|
||||
@@ -2859,6 +2861,10 @@ public class JellyfinController : ControllerBase
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("No playlist config found for Jellyfin ID {JellyfinId} - skipping count update", playlistId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3422,7 +3428,7 @@ public class JellyfinController : ControllerBase
|
||||
|
||||
// Build final track list based on playlist configuration
|
||||
// Local tracks position is configurable per-playlist
|
||||
var playlistConfig = _spotifySettings.GetPlaylistById(playlistId);
|
||||
var playlistConfig = _spotifySettings.GetPlaylistByJellyfinId(playlistId);
|
||||
var localTracksPosition = playlistConfig?.LocalTracksPosition ?? LocalTracksPosition.First;
|
||||
|
||||
var finalTracks = new List<Song>();
|
||||
|
||||
Reference in New Issue
Block a user