This repository was archived by the owner on Dec 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-21
lines changed Expand file tree Collapse file tree 1 file changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ export class AssetService {
247
247
return ;
248
248
}
249
249
const assetKeys = Object . keys ( assets ) ;
250
+ let result : IAssetMetadata ;
250
251
251
252
// Loop over assets and update if necessary
252
253
await assetKeys . forEachAsync ( async ( assetKey ) => {
@@ -255,29 +256,12 @@ export class AssetService {
255
256
const updatedAssetMetadata = this . updateTagInAssetMetadata ( assetMetadata , tagName , transformer ) ;
256
257
if ( updatedAssetMetadata ) {
257
258
await this . save ( updatedAssetMetadata ) ;
259
+ if ( currentAsset && currentAsset . asset . id === updatedAssetMetadata . asset . id ) {
260
+ result = updatedAssetMetadata ;
261
+ }
258
262
}
259
263
} ) ;
260
-
261
- // for (const assetKey of assetKeys) {
262
- // const asset = assets[assetKey];
263
- // if (asset.state !== AssetState.Tagged) {
264
- // debugger;
265
- // return;
266
- // }
267
- // const assetMetadata = await this.getAssetMetadata(asset);
268
- // debugger;
269
- // const updatedAssetMetadata = this.updateTagInAssetMetadata(assetMetadata, tagName, transformer);
270
- // debugger;
271
- // if (updatedAssetMetadata) {
272
- // await this.save(updatedAssetMetadata);
273
- // }
274
- // }
275
-
276
- if ( currentAsset ) {
277
- const asset = this . updateTagInAssetMetadata ( currentAsset , tagName , transformer ) ;
278
- debugger ;
279
- return asset ;
280
- }
264
+ return result ;
281
265
}
282
266
283
267
/**
You can’t perform that action at this time.
0 commit comments