mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: add asset upload medium test (#25144)
This commit is contained in:
@@ -78,7 +78,7 @@ export class AssetMediaCreateDto extends AssetMediaBase {
|
||||
@Optional()
|
||||
@ValidateNested({ each: true })
|
||||
@IsArray()
|
||||
metadata!: AssetMetadataUpsertItemDto[];
|
||||
metadata?: AssetMetadataUpsertItemDto[];
|
||||
|
||||
@ApiProperty({ type: 'string', format: 'binary', required: false })
|
||||
[UploadFieldName.SIDECAR_DATA]?: any;
|
||||
|
||||
@@ -258,6 +258,10 @@ export class AssetRepository {
|
||||
}
|
||||
|
||||
upsertMetadata(id: string, items: Array<{ key: string; value: object }>) {
|
||||
if (items.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.db
|
||||
.insertInto('asset_metadata')
|
||||
.values(items.map((item) => ({ assetId: id, ...item })))
|
||||
|
||||
Reference in New Issue
Block a user