2024-03-20 22:02:51 +01:00
|
|
|
import { AssetEntity } from 'src/entities/asset.entity';
|
2023-02-20 02:50:27 +01:00
|
|
|
import { Index, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
2024-01-31 00:23:33 +01:00
|
|
|
import { Column } from 'typeorm/decorator/columns/Column.js';
|
|
|
|
import { Entity } from 'typeorm/decorator/entity/Entity.js';
|
2022-02-11 03:40:11 +01:00
|
|
|
|
|
|
|
@Entity('exif')
|
|
|
|
export class ExifEntity {
|
2023-02-20 02:50:27 +01:00
|
|
|
@OneToOne(() => AssetEntity, { onDelete: 'CASCADE', nullable: true })
|
|
|
|
@JoinColumn()
|
|
|
|
asset?: AssetEntity;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2023-02-20 02:50:27 +01:00
|
|
|
@PrimaryColumn()
|
2022-06-25 19:53:06 +02:00
|
|
|
assetId!: string;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2022-08-21 01:31:37 +02:00
|
|
|
/* General info */
|
2023-02-20 02:50:27 +01:00
|
|
|
@Column({ type: 'text', default: '' })
|
2022-08-21 01:31:37 +02:00
|
|
|
description!: string; // or caption
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
exifImageWidth!: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
exifImageHeight!: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2022-08-26 18:07:59 +02:00
|
|
|
@Column({ type: 'bigint', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
fileSizeInByte!: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
orientation!: string | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
dateTimeOriginal!: Date | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
modifyDate!: Date | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2023-04-02 21:11:24 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
timeZone!: string | null;
|
|
|
|
|
2022-08-21 01:31:37 +02:00
|
|
|
@Column({ type: 'float', nullable: true })
|
|
|
|
latitude!: number | null;
|
|
|
|
|
|
|
|
@Column({ type: 'float', nullable: true })
|
|
|
|
longitude!: number | null;
|
|
|
|
|
2023-07-28 06:29:09 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
projectionType!: string | null;
|
|
|
|
|
2023-12-08 17:15:46 +01:00
|
|
|
@Index('exif_city')
|
2022-08-21 01:31:37 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
city!: string | null;
|
|
|
|
|
2023-02-16 08:41:51 +01:00
|
|
|
@Index('IDX_live_photo_cid')
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
livePhotoCID!: string | null;
|
|
|
|
|
2024-01-27 19:52:14 +01:00
|
|
|
@Index('IDX_auto_stack_id')
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
autoStackId!: string | null;
|
|
|
|
|
2022-08-21 01:31:37 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
state!: string | null;
|
|
|
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
country!: string | null;
|
|
|
|
|
|
|
|
/* Image info */
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
make!: string | null;
|
|
|
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
model!: string | null;
|
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
lensModel!: string | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
fNumber!: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
focalLength!: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
iso!: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2023-01-26 20:14:05 +01:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
exposureTime!: string | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
|
2023-09-26 01:18:47 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
profileDescription!: string | null;
|
|
|
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
colorspace!: string | null;
|
|
|
|
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
bitsPerSample!: number | null;
|
|
|
|
|
2024-08-09 19:45:52 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
rating!: number | null;
|
|
|
|
|
2022-08-21 01:31:37 +02:00
|
|
|
/* Video info */
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
|
|
|
fps?: number | null;
|
2022-02-11 03:40:11 +01:00
|
|
|
}
|