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 {
247247 return ;
248248 }
249249 const assetKeys = Object . keys ( assets ) ;
250+ let result : IAssetMetadata ;
250251
251252 // Loop over assets and update if necessary
252253 await assetKeys . forEachAsync ( async ( assetKey ) => {
@@ -255,29 +256,12 @@ export class AssetService {
255256 const updatedAssetMetadata = this . updateTagInAssetMetadata ( assetMetadata , tagName , transformer ) ;
256257 if ( updatedAssetMetadata ) {
257258 await this . save ( updatedAssetMetadata ) ;
259+ if ( currentAsset && currentAsset . asset . id === updatedAssetMetadata . asset . id ) {
260+ result = updatedAssetMetadata ;
261+ }
258262 }
259263 } ) ;
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 ;
281265 }
282266
283267 /**
You can’t perform that action at this time.
0 commit comments