Skip to content

Commit 4c0b60d

Browse files
committed
- attempt at reducing api calls
1 parent 99f165f commit 4c0b60d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

tools/spotify_music_quiz_cards.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,6 @@ <h3 class="text-lg font-semibold">${track.name}</h3>
339339
});
340340

341341
playerInstance.addListener('ready', async ({ device_id }) => {
342-
await fetch('https://api.spotify.com/v1/me/player', {
343-
method: 'PUT',
344-
headers: {
345-
'Authorization': `Bearer ${token}`,
346-
'Content-Type': 'application/json'
347-
},
348-
body: JSON.stringify({
349-
device_ids: [device_id],
350-
play: true
351-
})
352-
});
353342
const trackId = getUrlParameter('track');
354343
if (trackId) {
355344
await fetch(`https://api.spotify.com/v1/me/player/play?device_id=${device_id}`, {
@@ -380,7 +369,6 @@ <h3 class="text-lg font-semibold">${track.name}</h3>
380369
});
381370

382371
playerInstance.addListener('player_state_changed', state => {
383-
console.log('player_state_changed', state);
384372
if (state) {
385373
isPlaying = !state.paused;
386374
updateButtonIcon();

0 commit comments

Comments
 (0)