From 151d97756610afad3f60012104deea645b91affd Mon Sep 17 00:00:00 2001 From: Jan Svabenik Date: Thu, 28 May 2026 19:32:47 +0200 Subject: [PATCH] feat(ui): show total track length on progress bar instead of remaining Right-hand time on the playback bar now displays the full track length (e.g. 1:00:00) rather than the countdown (-49:39). Updated the progress-bar click-to-seek handler to read total directly from that label instead of deriving it from current + remaining. The canvas remaining-time display mode is untouched. Co-Authored-By: Claude Sonnet 4.6 --- web/static/app.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web/static/app.js b/web/static/app.js index 4707062..84b5679 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -181,11 +181,11 @@ function applyStatus(st) { currentLength = st.length; progressFill.style.width = (st.position / st.length * 100).toFixed(1) + '%'; timeCurrent.textContent = fmtTime(st.position); - timeLength.textContent = '-' + fmtTime(st.length - st.position); + timeLength.textContent = fmtTime(st.length); // total track length } else { progressFill.style.width = '0%'; timeCurrent.textContent = '0:00'; - timeLength.textContent = '-0:00'; + timeLength.textContent = '0:00'; } btnPlay.textContent = st.state === 'playing' ? SYM.pause : SYM.play; @@ -215,9 +215,8 @@ qsa('.btn-seek').forEach(function(btn) { }); $('progress-bar').addEventListener('click', function(e) { - var current = parseTime(timeCurrent.textContent); - var remaining = parseTime(timeLength.textContent.replace('-', '')); - var total = current + remaining; + var current = parseTime(timeCurrent.textContent); + var total = parseTime(timeLength.textContent); // right value is now total length if (!total) return; var rect = e.currentTarget.getBoundingClientRect(); var target = Math.round((e.clientX - rect.left) / rect.width * total);