-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
f139676
commit 373b691
Showing
38 changed files
with
1,366 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
mobile/android/fastlane/metadata/android/en-US/changelogs/13.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* New Feature - Selection backup. User can now select a combination of albums to be included or excluded during the backup process, and only unique photos, and videos that are not overlapping between the two groups will be backup. | ||
* Bug fix - Show correct count of backup and remainder assets. |
Binary file modified
BIN
+514 KB
(1000%)
mobile/android/metadata/en-US/images/phoneScreenshots/3_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+235 KB
(420%)
mobile/android/metadata/en-US/images/phoneScreenshots/4_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-109 KB
(40%)
mobile/android/metadata/en-US/images/phoneScreenshots/5_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
mobile/lib/modules/backup/models/available_album.model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import 'dart:typed_data'; | ||
|
||
import 'package:photo_manager/photo_manager.dart'; | ||
|
||
class AvailableAlbum { | ||
final AssetPathEntity albumEntity; | ||
final Uint8List? thumbnailData; | ||
AvailableAlbum({ | ||
required this.albumEntity, | ||
this.thumbnailData, | ||
}); | ||
|
||
AvailableAlbum copyWith({ | ||
AssetPathEntity? albumEntity, | ||
Uint8List? thumbnailData, | ||
}) { | ||
return AvailableAlbum( | ||
albumEntity: albumEntity ?? this.albumEntity, | ||
thumbnailData: thumbnailData ?? this.thumbnailData, | ||
); | ||
} | ||
|
||
@override | ||
String toString() => 'AvailableAlbum(albumEntity: $albumEntity, thumbnailData: $thumbnailData)'; | ||
|
||
@override | ||
bool operator ==(Object other) { | ||
if (identical(this, other)) return true; | ||
|
||
return other is AvailableAlbum && other.albumEntity == albumEntity && other.thumbnailData == thumbnailData; | ||
} | ||
|
||
@override | ||
int get hashCode => albumEntity.hashCode ^ thumbnailData.hashCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:photo_manager/photo_manager.dart'; | ||
|
||
import 'package:immich_mobile/modules/backup/models/available_album.model.dart'; | ||
import 'package:immich_mobile/shared/models/server_info.model.dart'; | ||
|
||
enum BackUpProgressEnum { idle, inProgress, done } | ||
|
||
class BackUpState extends Equatable { | ||
// enum | ||
final BackUpProgressEnum backupProgress; | ||
final List<String> allAssetOnDatabase; | ||
final double progressInPercentage; | ||
final CancelToken cancelToken; | ||
final ServerInfo serverInfo; | ||
|
||
/// All available albums on the device | ||
final List<AvailableAlbum> availableAlbums; | ||
final Set<AssetPathEntity> selectedBackupAlbums; | ||
final Set<AssetPathEntity> excludedBackupAlbums; | ||
|
||
/// Assets that are not overlapping in selected backup albums and excluded backup albums | ||
final Set<AssetEntity> allUniqueAssets; | ||
|
||
/// All assets from the selected albums that have been backup | ||
final Set<String> selectedAlbumsBackupAssetsIds; | ||
|
||
const BackUpState({ | ||
required this.backupProgress, | ||
required this.allAssetOnDatabase, | ||
required this.progressInPercentage, | ||
required this.cancelToken, | ||
required this.serverInfo, | ||
required this.availableAlbums, | ||
required this.selectedBackupAlbums, | ||
required this.excludedBackupAlbums, | ||
required this.allUniqueAssets, | ||
required this.selectedAlbumsBackupAssetsIds, | ||
}); | ||
|
||
BackUpState copyWith({ | ||
BackUpProgressEnum? backupProgress, | ||
List<String>? allAssetOnDatabase, | ||
double? progressInPercentage, | ||
CancelToken? cancelToken, | ||
ServerInfo? serverInfo, | ||
List<AvailableAlbum>? availableAlbums, | ||
Set<AssetPathEntity>? selectedBackupAlbums, | ||
Set<AssetPathEntity>? excludedBackupAlbums, | ||
Set<AssetEntity>? allUniqueAssets, | ||
Set<String>? selectedAlbumsBackupAssetsIds, | ||
}) { | ||
return BackUpState( | ||
backupProgress: backupProgress ?? this.backupProgress, | ||
allAssetOnDatabase: allAssetOnDatabase ?? this.allAssetOnDatabase, | ||
progressInPercentage: progressInPercentage ?? this.progressInPercentage, | ||
cancelToken: cancelToken ?? this.cancelToken, | ||
serverInfo: serverInfo ?? this.serverInfo, | ||
availableAlbums: availableAlbums ?? this.availableAlbums, | ||
selectedBackupAlbums: selectedBackupAlbums ?? this.selectedBackupAlbums, | ||
excludedBackupAlbums: excludedBackupAlbums ?? this.excludedBackupAlbums, | ||
allUniqueAssets: allUniqueAssets ?? this.allUniqueAssets, | ||
selectedAlbumsBackupAssetsIds: selectedAlbumsBackupAssetsIds ?? this.selectedAlbumsBackupAssetsIds, | ||
); | ||
} | ||
|
||
@override | ||
String toString() { | ||
return 'BackUpState(backupProgress: $backupProgress, allAssetOnDatabase: $allAssetOnDatabase, progressInPercentage: $progressInPercentage, cancelToken: $cancelToken, serverInfo: $serverInfo, availableAlbums: $availableAlbums, selectedBackupAlbums: $selectedBackupAlbums, excludedBackupAlbums: $excludedBackupAlbums, allUniqueAssets: $allUniqueAssets, selectedAlbumsBackupAssetsIds: $selectedAlbumsBackupAssetsIds)'; | ||
} | ||
|
||
@override | ||
List<Object> get props { | ||
return [ | ||
backupProgress, | ||
allAssetOnDatabase, | ||
progressInPercentage, | ||
cancelToken, | ||
serverInfo, | ||
availableAlbums, | ||
selectedBackupAlbums, | ||
excludedBackupAlbums, | ||
allUniqueAssets, | ||
selectedAlbumsBackupAssetsIds, | ||
]; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
mobile/lib/modules/backup/models/hive_backup_albums.model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:collection/collection.dart'; | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'hive_backup_albums.model.g.dart'; | ||
|
||
@HiveType(typeId: 1) | ||
class HiveBackupAlbums { | ||
@HiveField(0) | ||
List<String> selectedAlbumIds; | ||
|
||
@HiveField(1) | ||
List<String> excludedAlbumsIds; | ||
|
||
HiveBackupAlbums({ | ||
required this.selectedAlbumIds, | ||
required this.excludedAlbumsIds, | ||
}); | ||
|
||
@override | ||
String toString() => 'HiveBackupAlbums(selectedAlbumIds: $selectedAlbumIds, excludedAlbumsIds: $excludedAlbumsIds)'; | ||
|
||
HiveBackupAlbums copyWith({ | ||
List<String>? selectedAlbumIds, | ||
List<String>? excludedAlbumsIds, | ||
}) { | ||
return HiveBackupAlbums( | ||
selectedAlbumIds: selectedAlbumIds ?? this.selectedAlbumIds, | ||
excludedAlbumsIds: excludedAlbumsIds ?? this.excludedAlbumsIds, | ||
); | ||
} | ||
|
||
Map<String, dynamic> toMap() { | ||
final result = <String, dynamic>{}; | ||
|
||
result.addAll({'selectedAlbumIds': selectedAlbumIds}); | ||
result.addAll({'excludedAlbumsIds': excludedAlbumsIds}); | ||
|
||
return result; | ||
} | ||
|
||
factory HiveBackupAlbums.fromMap(Map<String, dynamic> map) { | ||
return HiveBackupAlbums( | ||
selectedAlbumIds: List<String>.from(map['selectedAlbumIds']), | ||
excludedAlbumsIds: List<String>.from(map['excludedAlbumsIds']), | ||
); | ||
} | ||
|
||
String toJson() => json.encode(toMap()); | ||
|
||
factory HiveBackupAlbums.fromJson(String source) => HiveBackupAlbums.fromMap(json.decode(source)); | ||
|
||
@override | ||
bool operator ==(Object other) { | ||
if (identical(this, other)) return true; | ||
final listEquals = const DeepCollectionEquality().equals; | ||
|
||
return other is HiveBackupAlbums && | ||
listEquals(other.selectedAlbumIds, selectedAlbumIds) && | ||
listEquals(other.excludedAlbumsIds, excludedAlbumsIds); | ||
} | ||
|
||
@override | ||
int get hashCode => selectedAlbumIds.hashCode ^ excludedAlbumsIds.hashCode; | ||
} |
42 changes: 42 additions & 0 deletions
42
mobile/lib/modules/backup/models/hive_backup_albums.model.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.