diff --git a/src/serialization/serialize-assets.js b/src/serialization/serialize-assets.js index d001baa0e..674b29f42 100644 --- a/src/serialization/serialize-assets.js +++ b/src/serialization/serialize-assets.js @@ -19,7 +19,7 @@ const serializeAssets = function (runtime, assetType) { const storage = runtime.storage; const storedAsset = storage.get(assetId); assetDescs.push({ - fileName: assetType === 'sound' ? + fileName: currAsset.md5 ? currAsset.md5 : `${assetId}.${storedAsset.dataFormat}`, fileContent: storedAsset.data}); } diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 797a68f87..6d97dfe46 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -537,6 +537,7 @@ class VirtualMachine extends EventEmitter { // If we're in here, we've edited an svg in the vector editor, // so the dataFormat should be 'svg' costume.dataFormat = storage.DataFormat.SVG; + costume.md5 = `${costume.assetId}.${costume.dataFormat}`; this.emitTargetsUpdate(); }