mirror of
https://github.com/JonasunderscoreJones/jonasjones.dev.git
synced 2025-10-23 08:59:19 +02:00
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:
parent
cc54405efd
commit
673e932f8a
1 changed files with 32 additions and 30 deletions
|
@ -35,6 +35,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchLastFmData() {
|
async function fetchLastFmData() {
|
||||||
|
try {
|
||||||
let response = await fetch(fetch_url);
|
let response = await fetch(fetch_url);
|
||||||
let data = await response.json();
|
let data = await response.json();
|
||||||
let album_cover = data.recenttracks.track[0].image[1]["#text"];
|
let album_cover = data.recenttracks.track[0].image[1]["#text"];
|
||||||
|
@ -70,6 +71,7 @@
|
||||||
"/pause-icon-256.png";
|
"/pause-icon-256.png";
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
fetchLastFmData();
|
fetchLastFmData();
|
||||||
setInterval(fetchLastFmData, 15000);
|
setInterval(fetchLastFmData, 15000);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue