fix: unlock properties after successful sidecar write (#25168)

This commit is contained in:
Daniel Dietzler
2026-01-12 07:01:38 -06:00
committed by GitHub
parent d4ad523eb3
commit 5e3f5f2b55
6 changed files with 97 additions and 0 deletions

View File

@@ -223,6 +223,17 @@ export class AssetRepository {
.execute();
}
@GenerateSql({ params: [DummyValue.UUID, ['description']] })
unlockProperties(assetId: string, properties: LockableProperty[]) {
return this.db
.updateTable('asset_exif')
.where('assetId', '=', assetId)
.set((eb) => ({
lockedProperties: sql`nullif(array(select distinct property from unnest(${eb.ref('asset_exif.lockedProperties')}) property where not property = any(${properties})), '{}')`,
}))
.execute();
}
async upsertJobStatus(...jobStatus: Insertable<AssetJobStatusTable>[]): Promise<void> {
if (jobStatus.length === 0) {
return;