Fixed issue where website would crash

Fixed an issue where the website would crash when a lastfm api fetch would go wrong. This occasionaly happens (for whatever reasons)
This commit is contained in:
J-onasJones 2023-09-27 13:55:58 +02:00
parent cc54405efd
commit 673e932f8a

View file

@ -35,6 +35,7 @@
}
async function fetchLastFmData() {
try {
let response = await fetch(fetch_url);
let data = await response.json();
let album_cover = data.recenttracks.track[0].image[1]["#text"];
@ -70,6 +71,7 @@
"/pause-icon-256.png";
} catch (error) {}
}
} catch (error) {}
}
fetchLastFmData();
setInterval(fetchLastFmData, 15000);