use higher res album art
This commit is contained in:
parent
644b5bee03
commit
29b22fd89b
BIN
img/disc.webp
BIN
img/disc.webp
Binary file not shown.
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 1.7 KiB |
11
index.html
11
index.html
|
@ -413,9 +413,14 @@
|
|||
<article id='listening'>
|
||||
<h2 id='listening-title'></h2>
|
||||
<script defer type='module'>
|
||||
const params = (new URL(document.location)).searchParams;
|
||||
let user = params.get('user');
|
||||
if (!user) {
|
||||
user = 'atbseefeldt';
|
||||
}
|
||||
const disc = './img/disc.webp';
|
||||
const lastfm_default_image = 'https://lastfm.freetls.fastly.net/i/u/34s/2a96cbd8b46e442fc41c2b86b821562f.png';
|
||||
const lastfm = await fetch('https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=atbseefeldt&api_key=5460c3381d64e7e9908b9fdfc5559747&format=json').then(r => r.json());
|
||||
const lastfm_default_image = 'https://lastfm.freetls.fastly.net/i/u/64s/2a96cbd8b46e442fc41c2b86b821562f.png';
|
||||
const lastfm = await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${user}&api_key=5460c3381d64e7e9908b9fdfc5559747&format=json`).then(r => r.json());
|
||||
if (!lastfm.error) {
|
||||
const listening = document.getElementById('listening');
|
||||
document.getElementById('listening-title').innerHTML = 'Listening to';
|
||||
|
@ -431,7 +436,7 @@
|
|||
classes += ' all-loaded';
|
||||
}
|
||||
trackHTML += `<div class='${classes}' title='${track.name.replaceAll("'","'")} — ${track.artist['#text'].replaceAll("'","'")}' onclick='if (!this.nextElementSibling) more_tracks(6)'>`;
|
||||
let image = track.image[0]['#text'];
|
||||
let image = track.image[1]['#text'];
|
||||
if (image === lastfm_default_image) {
|
||||
image = disc;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue