mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
* commit 1 (isPanorama: boolean) * working solution for projectiontypeenum * fix * format fix * fix * fix * fix * fix * enum projectiontype * working solution with exif * fix * reverted > * fix format * reverted auto-magic api.ts prettification * fix * reverted api.ts autogenerated * api ts regenerated * Update web/src/lib/components/assets/thumbnail/thumbnail.svelte Co-authored-by: Sergey Kondrikov <sergey.kondrikov@gmail.com> * Update web/src/lib/components/asset-viewer/asset-viewer.svelte Co-authored-by: Sergey Kondrikov <sergey.kondrikov@gmail.com> * exifProjectionType * Update server/src/microservices/processors/metadata-extraction.processor.ts Co-authored-by: Sergey Kondrikov <sergey.kondrikov@gmail.com> * projectionType?: string = ProjectionType.NONE; * not null * projectionType!: ProjectionType; * opeapi generator fix * fixes * fix * fix * generate api * asset.exifInifo?.projectionType * Update server/src/domain/asset/response-dto/exif-response.dto.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * Update server/src/microservices/processors/metadata-extraction.processor.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * enum -> varchar;projectiontypeenum->projectiontype * asset-viewer fixed prettiffier * @Column({}) single line * enum | string * make api * enum | string * enum | str fix * fix * chore: use string instead of enum * chore: open api * fix: checks --------- Co-authored-by: Sergey Kondrikov <sergey.kondrikov@gmail.com> Co-authored-by: Alex Tran <alex.tran1502@gmail.com> Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
103 lines
2.8 KiB
TypeScript
103 lines
2.8 KiB
TypeScript
import { Index, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
|
import { Column } from 'typeorm/decorator/columns/Column';
|
|
import { Entity } from 'typeorm/decorator/entity/Entity';
|
|
import { AssetEntity } from './asset.entity';
|
|
|
|
@Entity('exif')
|
|
export class ExifEntity {
|
|
@OneToOne(() => AssetEntity, { onDelete: 'CASCADE', nullable: true })
|
|
@JoinColumn()
|
|
asset?: AssetEntity;
|
|
|
|
@PrimaryColumn()
|
|
assetId!: string;
|
|
|
|
/* General info */
|
|
@Column({ type: 'text', default: '' })
|
|
description!: string; // or caption
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
exifImageWidth!: number | null;
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
exifImageHeight!: number | null;
|
|
|
|
@Column({ type: 'bigint', nullable: true })
|
|
fileSizeInByte!: number | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
orientation!: string | null;
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
|
dateTimeOriginal!: Date | null;
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
|
modifyDate!: Date | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
timeZone!: string | null;
|
|
|
|
@Column({ type: 'float', nullable: true })
|
|
latitude!: number | null;
|
|
|
|
@Column({ type: 'float', nullable: true })
|
|
longitude!: number | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
projectionType!: string | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
city!: string | null;
|
|
|
|
@Index('IDX_live_photo_cid')
|
|
@Column({ type: 'varchar', nullable: true })
|
|
livePhotoCID!: string | null;
|
|
|
|
@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;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
lensModel!: string | null;
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
|
fNumber!: number | null;
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
|
focalLength!: number | null;
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
iso!: number | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
exposureTime!: string | null;
|
|
|
|
/* Video info */
|
|
@Column({ type: 'float8', nullable: true })
|
|
fps?: number | null;
|
|
|
|
@Index('exif_text_searchable', { synchronize: false })
|
|
@Column({
|
|
type: 'tsvector',
|
|
generatedType: 'STORED',
|
|
asExpression: `TO_TSVECTOR('english',
|
|
COALESCE(make, '') || ' ' ||
|
|
COALESCE(model, '') || ' ' ||
|
|
COALESCE(orientation, '') || ' ' ||
|
|
COALESCE("lensModel", '') || ' ' ||
|
|
COALESCE("city", '') || ' ' ||
|
|
COALESCE("state", '') || ' ' ||
|
|
COALESCE("country", ''))`,
|
|
})
|
|
exifTextSearchableColumn!: string;
|
|
}
|