mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
Transfer repository from Gitlab
This commit is contained in:
parent
af2efbdbbd
commit
568cc243f0
177 changed files with 13300 additions and 0 deletions
77
mobile/lib/shared/models/backup_state.model.dart
Normal file
77
mobile/lib/shared/models/backup_state.model.dart
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:immich_mobile/shared/models/server_info.model.dart';
|
||||
|
||||
enum BackUpProgressEnum { idle, inProgress, done }
|
||||
|
||||
class BackUpState {
|
||||
final BackUpProgressEnum backupProgress;
|
||||
final int totalAssetCount;
|
||||
final int assetOnDatabase;
|
||||
final int backingUpAssetCount;
|
||||
final double progressInPercentage;
|
||||
final CancelToken cancelToken;
|
||||
final ServerInfo serverInfo;
|
||||
|
||||
BackUpState({
|
||||
required this.backupProgress,
|
||||
required this.totalAssetCount,
|
||||
required this.assetOnDatabase,
|
||||
required this.backingUpAssetCount,
|
||||
required this.progressInPercentage,
|
||||
required this.cancelToken,
|
||||
required this.serverInfo,
|
||||
});
|
||||
|
||||
BackUpState copyWith({
|
||||
BackUpProgressEnum? backupProgress,
|
||||
int? totalAssetCount,
|
||||
int? assetOnDatabase,
|
||||
int? backingUpAssetCount,
|
||||
double? progressInPercentage,
|
||||
CancelToken? cancelToken,
|
||||
ServerInfo? serverInfo,
|
||||
}) {
|
||||
return BackUpState(
|
||||
backupProgress: backupProgress ?? this.backupProgress,
|
||||
totalAssetCount: totalAssetCount ?? this.totalAssetCount,
|
||||
assetOnDatabase: assetOnDatabase ?? this.assetOnDatabase,
|
||||
backingUpAssetCount: backingUpAssetCount ?? this.backingUpAssetCount,
|
||||
progressInPercentage: progressInPercentage ?? this.progressInPercentage,
|
||||
cancelToken: cancelToken ?? this.cancelToken,
|
||||
serverInfo: serverInfo ?? this.serverInfo,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BackUpState(backupProgress: $backupProgress, totalAssetCount: $totalAssetCount, assetOnDatabase: $assetOnDatabase, backingUpAssetCount: $backingUpAssetCount, progressInPercentage: $progressInPercentage, cancelToken: $cancelToken, serverInfo: $serverInfo)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is BackUpState &&
|
||||
other.backupProgress == backupProgress &&
|
||||
other.totalAssetCount == totalAssetCount &&
|
||||
other.assetOnDatabase == assetOnDatabase &&
|
||||
other.backingUpAssetCount == backingUpAssetCount &&
|
||||
other.progressInPercentage == progressInPercentage &&
|
||||
other.cancelToken == cancelToken &&
|
||||
other.serverInfo == serverInfo;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return backupProgress.hashCode ^
|
||||
totalAssetCount.hashCode ^
|
||||
assetOnDatabase.hashCode ^
|
||||
backingUpAssetCount.hashCode ^
|
||||
progressInPercentage.hashCode ^
|
||||
cancelToken.hashCode ^
|
||||
serverInfo.hashCode;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue