Streamline
This commit is contained in:
parent
e1a3475faa
commit
5befc53d8c
1 changed files with 6 additions and 10 deletions
|
@ -240,15 +240,15 @@ export const uploader = async (
|
|||
|
||||
const file = await readAsset(fileTypeInfo, uploadAsset);
|
||||
|
||||
if (file.hasStaticThumbnail) {
|
||||
metadata.hasStaticThumbnail = true;
|
||||
}
|
||||
if (file.hasStaticThumbnail) metadata.hasStaticThumbnail = true;
|
||||
|
||||
const pubMagicMetadata = await constructPublicMagicMetadata({
|
||||
...publicMagicMetadata,
|
||||
uploaderName,
|
||||
});
|
||||
|
||||
abortIfCancelled();
|
||||
|
||||
const fileWithMetadata: FileWithMetadata = {
|
||||
localID,
|
||||
filedata: file.filedata,
|
||||
|
@ -257,8 +257,6 @@ export const uploader = async (
|
|||
pubMagicMetadata,
|
||||
};
|
||||
|
||||
abortIfCancelled();
|
||||
|
||||
const encryptedFile = await encryptFile(
|
||||
worker,
|
||||
fileWithMetadata,
|
||||
|
@ -267,20 +265,18 @@ export const uploader = async (
|
|||
|
||||
abortIfCancelled();
|
||||
|
||||
const backupedFile: BackupedFile = await uploadToBucket(
|
||||
const backupedFile = await uploadToBucket(
|
||||
encryptedFile.file,
|
||||
makeProgessTracker,
|
||||
uploadService.getIsCFUploadProxyDisabled(),
|
||||
);
|
||||
|
||||
const uploadFile: UploadFile = {
|
||||
const uploadedFile = await uploadService.uploadFile({
|
||||
collectionID: collection.id,
|
||||
encryptedKey: encryptedFile.fileKey.encryptedData,
|
||||
keyDecryptionNonce: encryptedFile.fileKey.nonce,
|
||||
...backupedFile,
|
||||
};
|
||||
|
||||
const uploadedFile = await uploadService.uploadFile(uploadFile);
|
||||
});
|
||||
|
||||
return {
|
||||
fileUploadResult: metadata.hasStaticThumbnail
|
||||
|
|
Loading…
Add table
Reference in a new issue