From 04b24ee86b6e6e7d832e9b96f38df411e1882438 Mon Sep 17 00:00:00 2001 From: Simon Caron Date: Sat, 12 Oct 2024 14:27:51 -0400 Subject: [PATCH] feat: Hide 0h on play button when media length is lower than an hour --- utils/time.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/time.ts b/utils/time.ts index 80b44cf0..8c541629 100644 --- a/utils/time.ts +++ b/utils/time.ts @@ -16,7 +16,8 @@ export const runtimeTicksToMinutes = ( const hours = Math.floor(ticks / ticksPerHour); const minutes = Math.floor((ticks % ticksPerHour) / ticksPerMinute); - return `${hours}h ${minutes}m`; + if (hours > 0) return `${hours}h ${minutes}m`; + else return `${minutes}m`; }; export const runtimeTicksToSeconds = (