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;