modified: app.py

modified:   templates/quiz.html
This commit is contained in:
2025-09-20 22:12:16 +02:00
parent 860d36aaf8
commit 76eaf45f5a
2 changed files with 14 additions and 5 deletions

View File

@@ -144,11 +144,14 @@
}
// Starte Wiedergabe an gewünschter Stelle
fetch(`/play_track?device_id=${device_id}&track_uri={{ track.uri }}&position_ms=${position_ms}`, { method: 'POST' })
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
.then(response => response.json())
.then(data => {
if (data.error === "device_not_found") {
alert(data.message || "Spotify-Player nicht gefunden. Die Seite wird neu geladen...");
window.location.reload();
return;
}
return response.json();
// ...bisheriger Code...
})
.catch(error => {
console.error('Error starting playback:', error);