|
@@ -29,6 +29,7 @@ import "package:photos/models/metadata/file_magic.dart";
|
|
|
import 'package:photos/models/upload_url.dart';
|
|
|
import "package:photos/models/user_details.dart";
|
|
|
import 'package:photos/services/collections_service.dart';
|
|
|
+import "package:photos/services/feature_flag_service.dart";
|
|
|
import "package:photos/services/file_magic_service.dart";
|
|
|
import 'package:photos/services/local_sync_service.dart';
|
|
|
import 'package:photos/services/sync_service.dart';
|
|
@@ -493,11 +494,15 @@ class FileUploader {
|
|
|
final String thumbnailObjectKey =
|
|
|
await _putFile(thumbnailUploadURL, encryptedThumbnailFile);
|
|
|
|
|
|
- final count = await calculatePartCount(
|
|
|
- await encryptedFile.length(),
|
|
|
- );
|
|
|
+ // Calculate the number of parts for the file. Multiple part upload
|
|
|
+ // is only enabled for internal users and debug builds till it's battle tested.
|
|
|
+ final count = FeatureFlagService.instance.isInternalUserOrDebugBuild()
|
|
|
+ ? await calculatePartCount(
|
|
|
+ await encryptedFile.length(),
|
|
|
+ )
|
|
|
+ : 1;
|
|
|
|
|
|
- String fileObjectKey;
|
|
|
+ late String fileObjectKey;
|
|
|
|
|
|
if (count <= 1) {
|
|
|
final fileUploadURL = await _getUploadURL();
|