Skip to content

High performance self-hosted photo and video management solution.

feat(mobile) reused HTTP client for uploading assets (#1487)

Alex830fec0c299c
diff --git a/mobile/lib/modules/backup/services/backup.service.dart b/mobile/lib/modules/backup/services/backup.service.dart
index deb16c55fc..e1b551da9a 100644
--- a/mobile/lib/modules/backup/services/backup.service.dart
+++ b/mobile/lib/modules/backup/services/backup.service.dart
@@ -29,6 +29,7 @@ final backupServiceProvider = Provider(
);
class BackupService {
+ final httpClient = http.Client();
final ApiService _apiService;
BackupService(this._apiService);
@@ -282,7 +283,8 @@ class BackupService {
),
);
- var response = await req.send(cancellationToken: cancelToken);
+ var response =
+ await httpClient.send(req, cancellationToken: cancelToken);
if (response.statusCode == 200) {
// asset is a duplicate (already exists on the server)
@@ -334,7 +336,6 @@ class BackupService {
Future<MultipartFile?> _getLivePhotoFile(AssetEntity entity) async {
var motionFilePath = await entity.getMediaUrl();
- // var motionFilePath = '/var/mobile/Media/DCIM/103APPLE/IMG_3371.MOV'
if (motionFilePath != null) {
var validPath = motionFilePath.replaceAll('file://', '');