diff --git a/frontend/app.js b/frontend/app.js index 223f3b9..0653f71 100755 --- a/frontend/app.js +++ b/frontend/app.js @@ -1199,8 +1199,20 @@ function updateProgress() { els.durTime.textContent = fmtTime(dur); if (dur) els.seek.value = String((cur / dur) * 1000); updateMiniBar(); - // A-B loop: if both points are set and we pass B, jump to A - if (abA !== null && abB !== null && abB > abA && cur >= abB) Player.seek(abA); + // A-B loop: passing B behaves like the track ending. Loop the A-B segment only + // when "loop current" is on; otherwise B is the effective end of the track and + // we advance per the repeat settings (next track, or wrap when "repeat list"). + if (abA !== null && abB !== null && abB > abA && cur >= abB) { + if (data.settings.loopOne) { + Player.seek(abA); + } else if (!advanceQueue()) { + // Nothing to advance to (repeat off, last track) — stop at B like a real end. + Player.pause(); + Player.seek(abA); + updatePlayBtn(); + $('upnext').classList.add('hidden'); + } + } } // ============================================================================