From 4c46593bc501cc6ecf81828dd3fc2bcb6559d6c3 Mon Sep 17 00:00:00 2001 From: Armin Date: Thu, 9 Jul 2026 00:58:41 +0200 Subject: [PATCH] omit hours (HH) when 00 and minutes pad only when >=10 in time displays --- index.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 58bc974..03213c2 100644 --- a/index.html +++ b/index.html @@ -138,11 +138,11 @@ footer .footer-track { flex: 1; min-width: 0; white-space: nowrap; overflow: hid
- 00:00:00 + 0:00
- 00:00:00 + 0:00
@@ -155,7 +155,7 @@ footer .footer-track { flex: 1; min-width: 0; white-space: nowrap; overflow: hid
Unknown
Unknown Artist
-
00:00:00 / 00:00:00
+
0:00 / 0:00
@@ -818,10 +818,11 @@ const GENRES = [ 'Christian Rock','Merengue','Salsa','Thrash Metal','Anime','JPop','Synthpop' ]; function fmtTime(s) { - if (!isFinite(s) || s < 0) return '00:00:00'; + if (!isFinite(s) || s < 0) return '0:00'; const h = Math.floor(s / 3600); const m = Math.floor((s % 3600) / 60); const sec = Math.floor(s % 60); + if (h === 0) return `${m}:${sec.toString().padStart(2, '0')}`; return `${h.toString().padStart(2, '0')}:${m.toString().padStart(2, '0')}:${sec.toString().padStart(2, '0')}`; } function showError(msg) {