refactor(server): remove asset placeholder (#17621)

chore: remove AssetEntityPlaceholder

Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
Jonathan Jogenfors 2025-04-15 21:53:49 +02:00 committed by GitHub
parent 21becbf1b0
commit 76db8cf604
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 13 deletions

View File

@ -53,12 +53,6 @@ export class AssetEntity {
duplicateId!: string | null;
}
export type AssetEntityPlaceholder = AssetEntity & {
fileCreatedAt: Date | null;
fileModifiedAt: Date | null;
localDateTime: Date | null;
};
export function withExif<O>(qb: SelectQueryBuilder<DB, 'assets', O>) {
return qb
.leftJoin('exif', 'assets.id', 'exif.assetId')

View File

@ -6,7 +6,6 @@ import { AssetFiles, AssetJobStatus, Assets, DB, Exif } from 'src/db';
import { Chunked, ChunkedArray, DummyValue, GenerateSql } from 'src/decorators';
import {
AssetEntity,
AssetEntityPlaceholder,
hasPeople,
searchAssetBuilder,
truncatedDate,
@ -236,12 +235,8 @@ export class AssetRepository {
.execute();
}
create(asset: Insertable<Assets>): Promise<AssetEntityPlaceholder> {
return this.db
.insertInto('assets')
.values(asset)
.returningAll()
.executeTakeFirst() as any as Promise<AssetEntityPlaceholder>;
create(asset: Insertable<Assets>): Promise<AssetEntity> {
return this.db.insertInto('assets').values(asset).returningAll().executeTakeFirst() as any as Promise<AssetEntity>;
}
createAll(assets: Insertable<Assets>[]): Promise<AssetEntity[]> {