fix: load album art via local /art proxy instead of external URL

WebEngine blocks fetching external Spotify URLs from local content.
Now uses http://127.0.0.1:8765/art which proxies the image locally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ltadeu6 2026-06-07 10:31:26 -03:00
parent b6e0ef1c3c
commit b4bf048487
No known key found for this signature in database
GPG key ID: FB9FDAB6B6F3418D

View file

@ -1055,27 +1055,15 @@ const albumArtEl = document.getElementById('albumArt');
let lastArtUrl = '';
function setAlbumArt(url) {
if (!url || url === lastArtUrl) return;
lastArtUrl = url;
fetch(url)
.then(r => r.blob())
.then(blob => {
const reader = new FileReader();
reader.onload = () => {
albumArtEl.style.backgroundImage = `url('${reader.result}')`;
};
reader.readAsDataURL(blob);
})
.catch(() => {});
}
function fetchTheme() {
fetch('http://127.0.0.1:8765/current')
.then(r => r.json())
.then(d => {
if (d.rgb) applyTheme(d.rgb);
if (d.art_url) setAlbumArt(d.art_url);
if (d.art_url && d.art_url !== lastArtUrl) {
lastArtUrl = d.art_url;
albumArtEl.style.backgroundImage = "url('http://127.0.0.1:8765/art')";
}
})
.catch(() => {});
}