add image fallback to library artists
This commit is contained in:
parent
8e89040b19
commit
8f9851c50f
1 changed files with 9 additions and 3 deletions
|
|
@ -26081,9 +26081,15 @@ function updateArtistHeroSection(artist, discography) {
|
||||||
|
|
||||||
imageElement.onerror = () => {
|
imageElement.onerror = () => {
|
||||||
console.error(`❌ Failed to load artist image: ${artist.image_url}`);
|
console.error(`❌ Failed to load artist image: ${artist.image_url}`);
|
||||||
imageElement.style.display = "none";
|
// Try Deezer fallback before emoji
|
||||||
if (fallbackElement) {
|
if (artist.deezer_id && !imageElement.dataset.triedDeezer) {
|
||||||
fallbackElement.style.display = "flex";
|
imageElement.dataset.triedDeezer = 'true';
|
||||||
|
imageElement.src = `https://api.deezer.com/artist/${artist.deezer_id}/image?size=big`;
|
||||||
|
} else {
|
||||||
|
imageElement.style.display = "none";
|
||||||
|
if (fallbackElement) {
|
||||||
|
fallbackElement.style.display = "flex";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue