Frank Stellmacher
5231169a71
refactor(format): consolidate duration formatters into format/formatDuration (Phase L, part 2) ( #690 )
...
The mm:ss track-time formatter was hand-rolled in 11 places and the
h:mm:ss total-duration formatter in 4 — extract two tested functions:
- formatTrackTime(seconds, fallback='0:00') — m:ss, used for track /
playback times. fallback param covers the '–' placeholder rows.
- formatLongDuration(seconds) — h:mm:ss when >=1h, else
m:ss, used for album / queue totals.
Behaviour preserved per call site: the unified guard
(!seconds || !isFinite || <0 -> fallback) produces identical output to
every prior variant for all real inputs; SongRow keeps its '–' via the
fallback arg. Removes the formatter exports from 6 componentHelpers
files (playerBarHelpers / fullscreenPlayerHelpers deleted — they only
exported the formatter) and 7 inline component copies.
+ formatDuration.test.ts
2026-05-14 14:50:10 +02:00
..
2026-05-14 01:19:58 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 12:12:16 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 11:57:12 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-04-24 00:51:35 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-13 00:46:13 +02:00
2026-05-13 00:05:58 +02:00
2026-05-14 14:27:44 +02:00
2026-04-21 12:10:02 +02:00
2026-05-06 13:28:38 +03:00
2026-05-14 14:27:44 +02:00
2026-04-23 16:56:28 +02:00
2026-05-14 14:27:44 +02:00
2026-05-12 23:22:28 +02:00
2026-05-14 14:27:44 +02:00
2026-05-11 12:25:48 +02:00
2026-03-21 22:58:05 +01:00
2026-04-13 18:20:23 +02:00
2026-03-19 20:23:17 +01:00
2026-05-14 14:27:44 +02:00
2026-03-27 23:56:35 +01:00
2026-05-14 14:27:44 +02:00
2026-05-11 23:24:40 +02:00
2026-05-13 22:52:08 +02:00
2026-05-13 00:46:13 +02:00
2026-04-24 11:49:13 +02:00
2026-05-14 14:27:44 +02:00
2026-05-13 00:46:13 +02:00
2026-04-02 17:40:39 +02:00
2026-04-22 02:25:56 +02:00
2026-05-06 14:17:13 +02:00
2026-05-06 14:17:13 +02:00
2026-05-14 14:27:44 +02:00
2026-05-13 00:05:58 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-13 00:46:13 +02:00
2026-05-11 23:24:40 +02:00
2026-05-14 14:27:44 +02:00
2026-04-23 18:41:46 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-13 00:46:13 +02:00
2026-05-13 00:23:53 +02:00
2026-04-22 02:25:56 +02:00
2026-03-18 22:25:32 +01:00
2026-04-24 19:42:53 +02:00
2026-05-14 14:27:44 +02:00
2026-04-24 19:42:53 +02:00
2026-05-13 00:46:13 +02:00
2026-04-24 19:47:10 +02:00
2026-05-14 14:27:44 +02:00
2026-04-25 01:21:51 +02:00
2026-04-25 01:40:22 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-04-24 14:20:21 +02:00
2026-04-24 23:59:37 +02:00
2026-05-01 15:42:40 +03:00
2026-04-25 10:27:52 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-11 23:16:08 +02:00
2026-05-14 14:50:10 +02:00
2026-03-22 20:24:14 +01:00
2026-04-24 00:51:35 +02:00
2026-05-11 23:16:08 +02:00
2026-05-14 14:50:10 +02:00
2026-04-22 02:25:56 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:50:10 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:50:10 +02:00
2026-04-18 22:52:38 +02:00
2026-05-05 23:02:22 +02:00
2026-04-12 11:27:26 +02:00
2026-05-14 14:27:44 +02:00
2026-05-07 22:31:50 +02:00
2026-04-21 19:11:24 +02:00
2026-05-01 15:42:40 +03:00
2026-05-13 00:46:13 +02:00
2026-05-11 23:07:58 +02:00
2026-05-14 14:27:44 +02:00
2026-05-14 14:27:44 +02:00
2026-04-19 02:28:45 +02:00
2026-04-18 22:43:56 +02:00
2026-04-08 22:33:23 +02:00