From 3128b06b24a92717d2774ab1747f30dc8373bad6 Mon Sep 17 00:00:00 2001 From: Honey Date: Thu, 21 May 2026 09:47:06 +0200 Subject: [PATCH] fix: 15s scrobble, play count clarity, star always visible, all-songs actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Scrobble timer: 12s → 15s - Play count moved after action buttons, shown as "23×" (distinct from duration) - Song star/menu buttons always visible (removed opacity:0 hover-only rule) - Artist all-songs page: added star + 3-dots to every row (same as top songs) - Hero card: picks from full recent+frequent pool (was capped at first 5 = all frequent) Co-Authored-By: Claude Sonnet 4.6 --- src/components.js | 5 +++-- src/player.js | 2 +- src/views.js | 14 +++++++++++--- styles.css | 7 +++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components.js b/src/components.js index 0bb1a13..4c4ac49 100644 --- a/src/components.js +++ b/src/components.js @@ -46,7 +46,7 @@ export function makeSongItem(s, idx, list, { noArtistLink = false, noAlbumLink = ? ` · ${esc(s.album||'')}` : ''; const playsHtml = S.cfg.showPlayCount && s.playCount - ? `${s.playCount.toLocaleString()}` : ''; + ? `${s.playCount.toLocaleString()}×` : ''; el.innerHTML = `
${idx+1}
${cv ? `` : '
♪
'}
@@ -54,11 +54,12 @@ export function makeSongItem(s, idx, list, { noArtistLink = false, noAlbumLink =
${artistHtml}${albumHtml}
- ${playsHtml}${formatDur(s.duration)} + ${formatDur(s.duration)}
+ ${playsHtml}
`; const btns = el.querySelectorAll('.icon-btn'); btns[0].onclick = (e) => { e.stopPropagation(); toggleStar(s, btns[0]); }; diff --git a/src/player.js b/src/player.js index 945dc17..97174af 100644 --- a/src/player.js +++ b/src/player.js @@ -27,7 +27,7 @@ function _scheduleScrobble(id) { _scrobbleTimer = setTimeout(() => { if (_scrobbleId) api('scrobble', `&id=${_scrobbleId}&time=${Date.now()}`).catch(() => {}); _scrobbleId = null; - }, 12_000); + }, 15_000); } function _cancelScrobble() { clearTimeout(_scrobbleTimer); diff --git a/src/views.js b/src/views.js index a15463e..2ad3c4d 100644 --- a/src/views.js +++ b/src/views.js @@ -133,7 +133,7 @@ async function loadHeroCard() { // Deduplicate by id, prefer frequent (weighted taste signal), pad with recent 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() * Math.min(5, pool.length))] : null; + const album = pool.length ? pool[Math.floor(Math.random() * pool.length)] : null; if (!album) return; const bgUrl = coverUrl(album.coverArt, 1024); const thumbUrl = coverUrl(album.coverArt, 512); @@ -579,13 +579,21 @@ export async function loadArtistAllSongs({ albums, artist }) { el.appendChild(h); } const cv = coverUrl(s.coverArt, 60); + if(s.starred && !s._starred) s._starred = true; const row = document.createElement('div'); row.className = 'topsong-item'; row.innerHTML = `
${s.trackNumber||''}
${cv?``:'
🎵
'}
-
${esc(s.title)}
-
${s.playCount?s.playCount.toLocaleString():''}
`; +
${esc(s.title)}
+
${s.playCount?s.playCount.toLocaleString():''}
+
+ + +
`; row.onclick = () => playQueue(allSongs, i); row.addEventListener('contextmenu', e => { e.preventDefault(); showCtxMenu(e, s, allSongs, i); }); + const btns = row.querySelectorAll('.icon-btn'); + btns[0].onclick = e => { e.stopPropagation(); toggleStar(s, btns[0]); }; + btns[1].onclick = e => { e.stopPropagation(); showCtxMenu(e, s, allSongs, i); }; el.appendChild(row); }); } diff --git a/styles.css b/styles.css index 22ad08e..d1f18ce 100644 --- a/styles.css +++ b/styles.css @@ -219,10 +219,9 @@ button:focus{outline:none} .song-info .song-artist{font-size:11px;color:var(--text2);margin-top:1px} .song-meta{display:flex;align-items:center;gap:6px} .song-dur{font-size:11px;color:var(--text3);font-family:var(--mono)} -.song-plays{font-size:11px;color:var(--text3);font-family:var(--mono)} -.song-actions{display:flex;gap:2px;opacity:0;transition:opacity .15s} -.song-item:hover .song-actions{opacity:1} -@media (hover:none),(pointer:coarse){.song-actions{opacity:1}} +.song-plays{font-size:11px;color:var(--text3);font-family:var(--mono);min-width:28px;text-align:right} +.song-plays-x{font-size:9px;opacity:.6;margin-left:1px} +.song-actions{display:flex;gap:2px} /* ── PLAYLIST DRAG & DROP ── */ .song-list.pl-draggable .song-item{grid-template-columns:18px 32px 44px 1fr auto} .pl-drag-handle{display:flex;align-items:center;justify-content:center;color:var(--text3);opacity:0;cursor:grab;transition:opacity .15s;touch-action:none}