mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
fix(mobile): Fix background backup on iOS (#4038)
This commit is contained in:
parent
fd6ade2b5d
commit
47ea47ce14
2 changed files with 16 additions and 1 deletions
11
mobile/.vscode/settings.json
vendored
Normal file
11
mobile/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"dart.flutterSdkPath": ".fvm/flutter_sdk",
|
||||||
|
// Remove .fvm files from search
|
||||||
|
"search.exclude": {
|
||||||
|
"**/.fvm": true
|
||||||
|
},
|
||||||
|
// Remove from file watching
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/.fvm": true
|
||||||
|
}
|
||||||
|
}
|
|
@ -218,6 +218,9 @@ class BackupService {
|
||||||
bool anyErrors = false;
|
bool anyErrors = false;
|
||||||
final List<String> duplicatedAssetIds = [];
|
final List<String> duplicatedAssetIds = [];
|
||||||
|
|
||||||
|
// DON'T KNOW WHY BUT THIS HELPS BACKGROUND BACKUP TO WORK ON IOS
|
||||||
|
await PhotoManager.requestPermissionExtend();
|
||||||
|
|
||||||
for (var entity in assetList) {
|
for (var entity in assetList) {
|
||||||
try {
|
try {
|
||||||
if (entity.type == AssetType.video) {
|
if (entity.type == AssetType.video) {
|
||||||
|
@ -248,7 +251,8 @@ class BackupService {
|
||||||
|
|
||||||
req.fields['deviceAssetId'] = entity.id;
|
req.fields['deviceAssetId'] = entity.id;
|
||||||
req.fields['deviceId'] = deviceId;
|
req.fields['deviceId'] = deviceId;
|
||||||
req.fields['fileCreatedAt'] = entity.createDateTime.toUtc().toIso8601String();
|
req.fields['fileCreatedAt'] =
|
||||||
|
entity.createDateTime.toUtc().toIso8601String();
|
||||||
req.fields['fileModifiedAt'] =
|
req.fields['fileModifiedAt'] =
|
||||||
entity.modifiedDateTime.toUtc().toIso8601String();
|
entity.modifiedDateTime.toUtc().toIso8601String();
|
||||||
req.fields['isFavorite'] = entity.isFavorite.toString();
|
req.fields['isFavorite'] = entity.isFavorite.toString();
|
||||||
|
|
Loading…
Reference in a new issue