mirror of
https://github.com/immich-app/immich.git
synced 2024-11-18 03:19:01 -07:00
40a8115101
* Fixed app not resuming backup after closing and reopening the app * Fixed cosmetic effect of backup button doesn't change state right away after pressing start backup * Fixed grammar * Fixed deep copy problem that cause incorrect asset count when backing up * Format code
56 lines
1.1 KiB
Dart
56 lines
1.1 KiB
Dart
import 'dart:convert';
|
|
|
|
class DeleteAssetResponse {
|
|
final String id;
|
|
final String status;
|
|
|
|
DeleteAssetResponse({
|
|
required this.id,
|
|
required this.status,
|
|
});
|
|
|
|
DeleteAssetResponse copyWith({
|
|
String? id,
|
|
String? status,
|
|
}) {
|
|
return DeleteAssetResponse(
|
|
id: id ?? this.id,
|
|
status: status ?? this.status,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'id': id,
|
|
'status': status,
|
|
};
|
|
}
|
|
|
|
factory DeleteAssetResponse.fromMap(Map<String, dynamic> map) {
|
|
return DeleteAssetResponse(
|
|
id: map['id'] ?? '',
|
|
status: map['status'] ?? '',
|
|
);
|
|
}
|
|
|
|
String toJson() => json.encode(toMap());
|
|
|
|
factory DeleteAssetResponse.fromJson(String source) =>
|
|
DeleteAssetResponse.fromMap(json.decode(source));
|
|
|
|
@override
|
|
String toString() => 'DeleteAssetResponse(id: $id, status: $status)';
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(this, other)) return true;
|
|
|
|
return other is DeleteAssetResponse &&
|
|
other.id == id &&
|
|
other.status == status;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => id.hashCode ^ status.hashCode;
|
|
}
|