Skip to content

High performance self-hosted photo and video management solution.

fix(cli): uploadCounters increase only when files are uploaded (#6357)

Bohan Zhangb98d1bf9d3b8
diff --git a/cli/src/commands/upload.ts b/cli/src/commands/upload.ts
index 796ae4923e..e647d38153 100644
--- a/cli/src/commands/upload.ts
+++ b/cli/src/commands/upload.ts
@@ -107,6 +107,8 @@ export class Upload extends BaseCommand {
const formData = asset.getUploadFormData();
const res = await this.uploadAsset(formData);
existingAssetId = res.data.id;
+ uploadCounter++;
+ totalSizeUploaded += asset.fileSize;
}
if ((options.album || options.albumName) && asset.albumName !== undefined) {
@@ -127,9 +129,6 @@ export class Upload extends BaseCommand {
}
}
}
-
- totalSizeUploaded += asset.fileSize;
- uploadCounter++;
}
sizeSoFar += asset.fileSize;