|
|
@ -75,19 +75,18 @@ Upload.upload = function (Env, safeKey, chunk, cb) {
|
|
|
|
Env.blobStore.upload(safeKey, chunk, cb);
|
|
|
|
Env.blobStore.upload(safeKey, chunk, cb);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Upload.complete = function (Env, safeKey, arg, cb) {
|
|
|
|
|
|
|
|
Env.blobStore.closeBlobstage(safeKey);
|
|
|
|
|
|
|
|
Env.completeUpload(safeKey, arg, false, cb);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Upload.cancel = function (Env, safeKey, arg, cb) {
|
|
|
|
Upload.cancel = function (Env, safeKey, arg, cb) {
|
|
|
|
Env.blobStore.cancel(safeKey, arg, cb);
|
|
|
|
Env.blobStore.cancel(safeKey, arg, cb);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Upload.complete_owned = function (Env, safeKey, arg, cb) {
|
|
|
|
var completeUpload = function (owned) {
|
|
|
|
Env.blobStore.closeBlobstage(safeKey);
|
|
|
|
return function (Env, safeKey, arg, cb) {
|
|
|
|
var user = Core.getSession(Env.Sessions, safeKey);
|
|
|
|
Env.blobStore.closeBlobstage(safeKey);
|
|
|
|
var size = user.pendingUploadSize;
|
|
|
|
var user = Core.getSession(Env.Sessions, safeKey);
|
|
|
|
Env.completeUpload(safeKey, arg, true, size, cb);
|
|
|
|
var size = user.pendingUploadSize;
|
|
|
|
|
|
|
|
Env.completeUpload(safeKey, arg, Boolean(owned), size, cb);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Upload.complete = completeUpload(false);
|
|
|
|
|
|
|
|
Upload.complete_owned = completeUpload(true);
|
|
|
|