Comparing version 1.0.0 to 1.0.1
@@ -69,5 +69,2 @@ // Require base | ||
// save if no id | ||
if (!asset.get('_id')) await asset.save(); | ||
// get upload url | ||
@@ -82,3 +79,3 @@ const uploadUrl = await this.store.getUploadUrl({ | ||
// Set path | ||
asset.set('path', `${date}-${asset.get('_id')}`); | ||
asset.set('path', `${date}/${asset.get('hash')}`); | ||
@@ -92,4 +89,4 @@ // await | ||
info : { | ||
id : asset.get('_id'), | ||
str : date, | ||
str : date, | ||
hash : asset.get('hash'), | ||
}, | ||
@@ -101,3 +98,3 @@ onUploadProgress : (event) => {}, // progress monitoring | ||
// set b2 info | ||
asset.set(`${label ? `${label}.` : ''}b2`, data); | ||
asset.set(`${label ? `thumbs.${label}.` : ''}b2`, data); | ||
} | ||
@@ -139,3 +136,3 @@ | ||
await this.store.deleteFileVersion({ | ||
fileId : asset.get(`${label ? `${label}.` : ''}b2.fileId`), | ||
fileId : asset.get(`${label ? `thumbs.${label}.` : ''}b2.fileId`), | ||
fileName : `${asset.get('path')}/${label ? `${label}.${asset.get(`thumbs.${label}.ext`)}` : `full.${asset.get('ext')}`}` | ||
@@ -142,0 +139,0 @@ }); |
{ | ||
"name": "@edenjs/b2", | ||
"description": "nothing yet", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "backblaze-b2": "^1.3.1" |
5416
154