From bb352f32665ec4c781d1d23db392265f327fef82 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 14 May 2025 15:43:32 +0530 Subject: [PATCH] mobile compat --- web/packages/gallery/services/upload/upload-service.ts | 2 +- web/packages/media/file-metadata.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/packages/gallery/services/upload/upload-service.ts b/web/packages/gallery/services/upload/upload-service.ts index 6eb7fb383e..0a6e6f2e7f 100644 --- a/web/packages/gallery/services/upload/upload-service.ts +++ b/web/packages/gallery/services/upload/upload-service.ts @@ -1078,7 +1078,7 @@ const extractImageOrVideoMetadata = async ( }; if (duration) { - metadata.duration = ensureNumber(duration); + metadata.duration = ensureInteger(Math.ceil(duration)); } const location = parsedMetadataJSON?.location ?? parsedMetadata?.location; diff --git a/web/packages/media/file-metadata.ts b/web/packages/media/file-metadata.ts index f3fdee0318..900dd89f4a 100644 --- a/web/packages/media/file-metadata.ts +++ b/web/packages/media/file-metadata.ts @@ -141,9 +141,11 @@ export interface Metadata { */ videoHash?: string; /** - * The duration (in seconds) of the video. + * The duration (in integral seconds) of the video. * - * Only present for videos (`fileType == FileType.video`). + * Only present for videos (`fileType == FileType.video`). For compatibility + * with other clients, this must be a integer number of seconds, without any + * sub-second fraction. */ duration?: number; hasStaticThumbnail?: boolean;