mirror of
https://github.com/immich-app/immich.git
synced 2025-10-30 10:12:33 -04:00
feat(server): enhance metadata reading for video files (#23258)
This commit is contained in:
parent
9e3b4ef3db
commit
44149d187f
@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
|
|||||||
import { BinaryField, DefaultReadTaskOptions, ExifTool, Tags } from 'exiftool-vendored';
|
import { BinaryField, DefaultReadTaskOptions, ExifTool, Tags } from 'exiftool-vendored';
|
||||||
import geotz from 'geo-tz';
|
import geotz from 'geo-tz';
|
||||||
import { LoggingRepository } from 'src/repositories/logging.repository';
|
import { LoggingRepository } from 'src/repositories/logging.repository';
|
||||||
|
import { mimeTypes } from 'src/utils/mime-types';
|
||||||
|
|
||||||
interface ExifDuration {
|
interface ExifDuration {
|
||||||
Value: number;
|
Value: number;
|
||||||
@ -103,7 +104,8 @@ export class MetadataRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readTags(path: string): Promise<ImmichTags> {
|
readTags(path: string): Promise<ImmichTags> {
|
||||||
return this.exiftool.read(path).catch((error) => {
|
const args = mimeTypes.isVideo(path) ? ['-ee'] : [];
|
||||||
|
return this.exiftool.read(path, args).catch((error) => {
|
||||||
this.logger.warn(`Error reading exif data (${path}): ${error}\n${error?.stack}`);
|
this.logger.warn(`Error reading exif data (${path}): ${error}\n${error?.stack}`);
|
||||||
return {};
|
return {};
|
||||||
}) as Promise<ImmichTags>;
|
}) as Promise<ImmichTags>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user