chore: remove exif entity (#17499)

This commit is contained in:
Daniel Dietzler
2025-04-10 18:36:29 +02:00
committed by GitHub
parent 8aea07b750
commit 7a1e8ce6d8
10 changed files with 44 additions and 76 deletions

View File

@@ -1,12 +1,11 @@
import { DeduplicateJoinsPlugin, ExpressionBuilder, Kysely, SelectQueryBuilder, sql } from 'kysely';
import { jsonArrayFrom, jsonObjectFrom } from 'kysely/helpers/postgres';
import { Tag, User } from 'src/database';
import { Exif, Tag, User } from 'src/database';
import { DB } from 'src/db';
import { AlbumEntity } from 'src/entities/album.entity';
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
import { AssetFileEntity } from 'src/entities/asset-files.entity';
import { AssetJobStatusEntity } from 'src/entities/asset-job-status.entity';
import { ExifEntity } from 'src/entities/exif.entity';
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
import { StackEntity } from 'src/entities/stack.entity';
import { AssetFileType, AssetStatus, AssetType } from 'src/enum';
@@ -47,7 +46,7 @@ export class AssetEntity {
livePhotoVideoId!: string | null;
originalFileName!: string;
sidecarPath!: string | null;
exifInfo?: ExifEntity;
exifInfo?: Exif;
tags?: Tag[];
sharedLinks!: SharedLinkEntity[];
albums?: AlbumEntity[];
@@ -65,7 +64,9 @@ export type AssetEntityPlaceholder = AssetEntity & {
};
export function withExif<O>(qb: SelectQueryBuilder<DB, 'assets', O>) {
return qb.leftJoin('exif', 'assets.id', 'exif.assetId').select((eb) => eb.fn.toJson(eb.table('exif')).as('exifInfo'));
return qb
.leftJoin('exif', 'assets.id', 'exif.assetId')
.select((eb) => eb.fn.toJson(eb.table('exif')).$castTo<Exif>().as('exifInfo'));
}
export function withExifInner<O>(qb: SelectQueryBuilder<DB, 'assets', O>) {