fix(server): exif duration with scale (#4541)
This commit is contained in:
@@ -7,6 +7,7 @@ import { Duration } from 'luxon';
|
||||
import { usePagination } from '../domain.util';
|
||||
import { IBaseJob, IEntityJob, JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from '../job';
|
||||
import {
|
||||
ExifDuration,
|
||||
IAlbumRepository,
|
||||
IAssetRepository,
|
||||
ICryptoRepository,
|
||||
@@ -398,7 +399,11 @@ export class MetadataService {
|
||||
return bitsPerSample;
|
||||
}
|
||||
|
||||
private getDuration(seconds?: number): string {
|
||||
return Duration.fromObject({ seconds }).toFormat('hh:mm:ss.SSS');
|
||||
private getDuration(seconds?: number | ExifDuration): string {
|
||||
let _seconds = seconds as number;
|
||||
if (typeof seconds === 'object') {
|
||||
_seconds = seconds.Value * (seconds?.Scale || 1);
|
||||
}
|
||||
return Duration.fromObject({ seconds: _seconds }).toFormat('hh:mm:ss.SSS');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user