immich/mobile/lib/domain/models/local_trashed_asset.model.dart
Peter Ombodi 020dfa7818 feat(db): add local_trashed_asset table and integrate with restoration flow
- Add new `local_trashed_asset` table to store metadata of trashed assets
- Save trashed asset info into `local_trashed_asset` before deletion
- Use `local_trashed_asset` as source for asset restoration
- Implement file restoration by `mediaId`
2025-09-09 18:54:37 +03:00

37 lines
971 B
Dart

class LocalTrashedAsset {
final String localId;
final String remoteId;
final DateTime createdAt;
const LocalTrashedAsset({required this.localId, required this.remoteId, required this.createdAt});
LocalTrashedAsset copyWith({String? localId, String? remoteId, DateTime? createdAt}) {
return LocalTrashedAsset(
localId: localId ?? this.localId,
remoteId: remoteId ?? this.remoteId,
createdAt: createdAt ?? this.createdAt,
);
}
@override
bool operator ==(Object other) {
if (other is! LocalTrashedAsset) return false;
if (identical(this, other)) return true;
return other.localId == localId && other.remoteId == remoteId && other.createdAt == createdAt;
}
@override
int get hashCode {
return localId.hashCode ^ remoteId.hashCode ^ createdAt.hashCode;
}
@override
String toString() {
return '''LocalTrashedAsset: {
localId: $localId,
remoteId: $remoteId,
createdAt: $createdAt
}''';
}
}