mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
feat(mobile) reused HTTP client for uploading assets (#1487)
* feat(mobile) reused HTTP client for uploading assets * remove unused comments
This commit is contained in:
parent
aa68d35f42
commit
830fec0c29
@ -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://', '');
|
||||
|
Loading…
Reference in New Issue
Block a user