feat: configurable scrobble timing (15s / 30s / 1/3 / 2/3 / end)

Settings dropdown: 15s (default), 30s, 1/3 of duration, 2/3 of duration, song end.
Duration-based modes use s.duration from Navidrome metadata (always available).
'end' mode skips the timer and fires the scrobble in onEnded (web) / onQueueEnded (native).
Skipping a song never scrobbles in any mode — _cancelScrobble() still runs on skip/pause.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-07 17:53:02 +02:00
1 parent acb15d8c00
commit 6391857fda
3 files changed
+33 -6

No files matched your search

+2
View File
@@ -50,6 +50,7 @@ export function openSettings() {
document.getElementById('s-show-playcount').classList.toggle('on', !!S.cfg.showPlayCount);
document.getElementById('s-show-romaji').classList.toggle('on', !!S.cfg.showRomaji);
document.getElementById('s-cover-color-bg').classList.toggle('on', !!S.cfg.coverColorBg);
document.getElementById('s-scrobble-mode').value = S.cfg.scrobbleMode || '15s';
_renderThemePicker();
document.getElementById('settings-modal').classList.add('open');
checkBackend();
@@ -131,6 +132,7 @@ export function saveSettings() {
const romajiChanged = S.cfg.showRomaji !== document.getElementById('s-show-romaji').classList.contains('on');
S.cfg.showRomaji = document.getElementById('s-show-romaji').classList.contains('on');
S.cfg.coverColorBg = document.getElementById('s-cover-color-bg').classList.contains('on');
S.cfg.scrobbleMode = document.getElementById('s-scrobble-mode').value || '15s';
updateNpColorMode();
localStorage.setItem('ns_cfg', JSON.stringify(S.cfg));
closeSettings(); toast('✅ Gespeichert');