2024-01-22 10:04:45 -08:00
|
|
|
import { BinaryField, Tags } from 'exiftool-vendored';
|
2023-09-27 20:44:51 +02:00
|
|
|
|
|
|
|
|
export const IMetadataRepository = 'IMetadataRepository';
|
|
|
|
|
|
2023-10-19 14:51:56 -04:00
|
|
|
export interface ExifDuration {
|
|
|
|
|
Value: number;
|
|
|
|
|
Scale?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ImmichTags extends Omit<Tags, 'FocalLength' | 'Duration'> {
|
2023-09-27 20:44:51 +02:00
|
|
|
ContentIdentifier?: string;
|
|
|
|
|
MotionPhoto?: number;
|
|
|
|
|
MotionPhotoVersion?: number;
|
|
|
|
|
MotionPhotoPresentationTimestampUs?: number;
|
|
|
|
|
MediaGroupUUID?: string;
|
|
|
|
|
ImagePixelDepth?: string;
|
2023-09-27 15:17:18 -04:00
|
|
|
FocalLength?: number;
|
2024-02-02 14:58:13 -06:00
|
|
|
Duration?: number | string | ExifDuration;
|
2024-01-22 10:04:45 -08:00
|
|
|
EmbeddedVideoType?: string;
|
|
|
|
|
EmbeddedVideoFile?: BinaryField;
|
|
|
|
|
MotionPhotoVideo?: BinaryField;
|
2023-09-27 20:44:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IMetadataRepository {
|
2023-10-18 18:02:42 -04:00
|
|
|
teardown(): Promise<void>;
|
2023-11-30 04:52:28 +01:00
|
|
|
readTags(path: string): Promise<ImmichTags | null>;
|
|
|
|
|
writeTags(path: string, tags: Partial<Tags>): Promise<void>;
|
2024-01-22 10:04:45 -08:00
|
|
|
extractBinaryTag(tagName: string, path: string): Promise<Buffer>;
|
2024-02-13 13:54:58 -06:00
|
|
|
getCountries(userId: string): Promise<string[]>;
|
|
|
|
|
getStates(userId: string, country?: string): Promise<string[]>;
|
|
|
|
|
getCities(userId: string, country?: string, state?: string): Promise<string[]>;
|
|
|
|
|
getCameraMakes(userId: string, model?: string): Promise<string[]>;
|
|
|
|
|
getCameraModels(userId: string, make?: string): Promise<string[]>;
|
2023-09-27 20:44:51 +02:00
|
|
|
}
|