diff options
| author | Matt Goldspink <mattgoldspink1@gmail.com> | 2022-06-16 21:07:31 -0700 |
|---|---|---|
| committer | Matt Goldspink <mattgoldspink1@gmail.com> | 2022-06-16 21:07:31 -0700 |
| commit | 8b3f0e911b5a296e664171c6135e674a4f101840 (patch) | |
| tree | 3d66199c545744d64a80389125c95467ac56ffa4 | |
| parent | eabec62bcbde91b183dc99d2171af35e9cf47c85 (diff) | |
| download | slskd-8b3f0e911b5a296e664171c6135e674a4f101840.tar.gz | |
Tracks that last longer than an hour don't show that.
I've fixed up the formatSeconds to test if it's longer than an hour then show the extra portion.
| -rw-r--r-- | src/web/src/lib/util.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/web/src/lib/util.js b/src/web/src/lib/util.js index 94095efa..20653737 100644 --- a/src/web/src/lib/util.js +++ b/src/web/src/lib/util.js @@ -3,6 +3,9 @@ export const formatSeconds = (seconds) => if (isNaN(seconds)) return ''; var date = new Date(1970,0,1); date.setSeconds(seconds); + if (seconds >= 3600) { + return date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1'); + } return date.toTimeString().replace(/.*(\d{2}:\d{2}).*/, '$1'); }; |
