diff --git a/src/components.js b/src/components.js index 4c4ac49..fbf1f3d 100644 --- a/src/components.js +++ b/src/components.js @@ -45,8 +45,9 @@ export function makeSongItem(s, idx, list, { noArtistLink = false, noAlbumLink = const albumHtml = !noAlbumLink && (s.albumId||s.album) ? ` · ${esc(s.album||'')}` : ''; - const playsHtml = S.cfg.showPlayCount && s.playCount - ? `${s.playCount.toLocaleString()}×` : ''; + const playsHtml = S.cfg.showPlayCount + ? `${s.playCount ? s.playCount.toLocaleString() + '×' : '—'}` + : ''; el.innerHTML = `
${idx+1}
${cv ? `` : '
♪
'}
diff --git a/src/views.js b/src/views.js index 2ad3c4d..7e25107 100644 --- a/src/views.js +++ b/src/views.js @@ -130,11 +130,13 @@ async function loadHeroCard() { ]); const freqList = freqRes.status === 'fulfilled' ? (freqRes.value.albumList2?.album || []) : []; const recList = recRes.status === 'fulfilled' ? (recRes.value.albumList2?.album || []) : []; - // Deduplicate by id, prefer frequent (weighted taste signal), pad with recent + // Deduplicate by id, tag source so we can show the right label + const freqIds = new Set(freqList.map(a => a.id)); const seen = new Set(); const pool = [...freqList, ...recList].filter(a => a.id && !seen.has(a.id) && seen.add(a.id)); const album = pool.length ? pool[Math.floor(Math.random() * pool.length)] : null; if (!album) return; + const heroLabel = freqIds.has(album.id) ? 'Meistgespielt' : 'Zuletzt gehört'; const bgUrl = coverUrl(album.coverArt, 1024); const thumbUrl = coverUrl(album.coverArt, 512); el.innerHTML = ` @@ -142,7 +144,7 @@ async function loadHeroCard() {
${thumbUrl ? `${esc(album.name)}` : ''}
-
Meistgespielt
+
${heroLabel}
${esc(album.name)}
${esc(album.artist || '')}