debug: log Spotify playlist entity structure to diagnose empty tracks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-27 02:03:00 +02:00
1 parent 393b88c823
commit 363fed61a5
1 file changed
+4
+4
View File
@@ -507,6 +507,9 @@ app.post('/api/spotify/resolve', async (req, res) => {
if (type === 'playlist') {
const trackList = entity.trackList || entity.content?.items || entity.tracks?.items || [];
const owner = entity.ownerV2?.data?.name || entity.owner?.displayName || entity.owner?.display_name || '';
const firstRaw = trackList[0];
console.log('[spotify/resolve] entity keys:', Object.keys(entity));
console.log('[spotify/resolve] trackList[0]:', JSON.stringify(firstRaw, null, 2).slice(0, 800));
return res.json({
type: 'playlist',
name: entity.name,
@@ -514,6 +517,7 @@ app.post('/api/spotify/resolve', async (req, res) => {
artworkUrl: artUrl,
description: entity.description || '',
tracks: trackList.map(t => _spTrackItem(t, null, null, null)),
_debug: { entityKeys: Object.keys(entity), firstTrack: firstRaw },
});
}