mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
fix(server): invalid video duration format (#2058)
This commit is contained in:
parent
8adf1231a3
commit
4dafc74223
1 changed files with 2 additions and 5 deletions
|
@ -20,6 +20,7 @@ import { ExifDateTime, exiftool, Tags } from 'exiftool-vendored';
|
|||
import ffmpeg, { FfprobeData } from 'fluent-ffmpeg';
|
||||
import { getName } from 'i18n-iso-countries';
|
||||
import geocoder, { InitOptions } from 'local-reverse-geocoder';
|
||||
import { Duration } from 'luxon';
|
||||
import fs from 'node:fs';
|
||||
import path from 'path';
|
||||
import sharp from 'sharp';
|
||||
|
@ -386,10 +387,6 @@ export class MetadataExtractionProcessor {
|
|||
return null;
|
||||
}
|
||||
|
||||
const hours = Math.floor(videoDurationInSecond / 3600);
|
||||
const minutes = Math.floor((videoDurationInSecond - hours * 3600) / 60);
|
||||
const seconds = videoDurationInSecond - hours * 3600 - minutes * 60;
|
||||
|
||||
return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}.000000`;
|
||||
return Duration.fromObject({ seconds: videoDurationInSecond }).toFormat('hh:mm:ss.SSS');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue