mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 15:45:10 -05:00
Fix undefined artists array causing syntax error
This commit is contained in:
@@ -1585,9 +1585,9 @@
|
||||
// Add manual map button for external tracks
|
||||
// Use JSON.stringify to properly escape strings for JavaScript
|
||||
const escapedName = JSON.stringify(name);
|
||||
const escapedTitle = JSON.stringify(t.title);
|
||||
const escapedArtist = JSON.stringify(t.artists[0] || '');
|
||||
const escapedSpotifyId = JSON.stringify(t.spotifyId);
|
||||
const escapedTitle = JSON.stringify(t.title || '');
|
||||
const escapedArtist = JSON.stringify((t.artists && t.artists[0]) || '');
|
||||
const escapedSpotifyId = JSON.stringify(t.spotifyId || '');
|
||||
mapButton = `<button class="small" onclick="openManualMap(${escapedName}, ${t.position}, ${escapedTitle}, ${escapedArtist}, ${escapedSpotifyId})" style="margin-left:8px;font-size:0.75rem;padding:4px 8px;">Map to Local</button>`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user