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:
parent
b6e0ef1c3c
commit
b4bf048487
1 changed files with 4 additions and 16 deletions
|
|
@ -1055,27 +1055,15 @@ const albumArtEl = document.getElementById('albumArt');
|
||||||
|
|
||||||
let lastArtUrl = '';
|
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() {
|
function fetchTheme() {
|
||||||
fetch('http://127.0.0.1:8765/current')
|
fetch('http://127.0.0.1:8765/current')
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(d => {
|
.then(d => {
|
||||||
if (d.rgb) applyTheme(d.rgb);
|
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(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue