fix: hero label shows source (Meistgespielt/Zuletzt gehört); play count column always visible when enabled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-21 09:53:43 +02:00
1 parent 3128b06b24
commit da185e1d96
2 files changed
+7 -4

No files matched your search

+4 -2
View File
@@ -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() {
<div class="home-hero-overlay">
${thumbUrl ? `<img class="home-hero-cover" src="${thumbUrl}" alt="${esc(album.name)}">` : ''}
<div class="home-hero-info">
<div class="home-hero-label">Meistgespielt</div>
<div class="home-hero-label">${heroLabel}</div>
<div class="home-hero-title">${esc(album.name)}</div>
<div class="home-hero-artist">${esc(album.artist || '')}</div>
</div>