From 52d90a828031ef613f55cc8f242c40e6e61567fe Mon Sep 17 00:00:00 2001 From: Yaros Date: Wed, 12 Mar 2025 15:18:43 +0100 Subject: [PATCH] fix(web): fixed formatting of video length (#16829) * fix(web): fixed formatting of video time * shortened the condition --- .../components/assets/thumbnail/video-thumbnail.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/lib/components/assets/thumbnail/video-thumbnail.svelte b/web/src/lib/components/assets/thumbnail/video-thumbnail.svelte index 09b1d1f0d7..a2e30be543 100644 --- a/web/src/lib/components/assets/thumbnail/video-thumbnail.svelte +++ b/web/src/lib/components/assets/thumbnail/video-thumbnail.svelte @@ -90,7 +90,13 @@
{#if showTime} - {Duration.fromObject({ seconds: remainingSeconds }).toFormat('m:ss')} + {#if remainingSeconds < 60} + {Duration.fromObject({ seconds: remainingSeconds }).toFormat('m:ss')} + {:else if remainingSeconds < 3600} + {Duration.fromObject({ seconds: remainingSeconds }).toFormat('mm:ss')} + {:else} + {Duration.fromObject({ seconds: remainingSeconds }).toFormat('h:mm:ss')} + {/if} {/if}