Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Ensure time to int returns an integer

Chocobozzzca889dbbb8bd
diff --git a/packages/core-utils/src/common/date.ts b/packages/core-utils/src/common/date.ts
index f3f0d4c653..f53a2c816c 100644
--- a/packages/core-utils/src/common/date.ts
+++ b/packages/core-utils/src/common/date.ts
@@ -49,7 +49,7 @@ export const timecodeRegexString = `(\\d+[h:])?(\\d+[m:])?\\d+s?`
function timeToInt (time: number | string) {
if (!time) return 0
- if (typeof time === 'number') return time
+ if (typeof time === 'number') return Math.floor(time)
// Try with 00h00m00s format first
const reg = new RegExp(`^((?<hours>\\d+)h)?((?<minutes>\\d+)m)?((?<seconds>\\d+)s?)?$`)