mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
trashed_local_asset<->local_asset transfer data on move to trash or restore refactor code
76 lines
1.9 KiB
Dart
76 lines
1.9 KiB
Dart
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
|
|
|
class TrashedAsset {
|
|
final String id;
|
|
final String name;
|
|
final String? volume;
|
|
final String albumId;
|
|
final String? checksum;
|
|
final AssetType type;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
|
|
const TrashedAsset({
|
|
required this.id,
|
|
required this.name,
|
|
required this.albumId,
|
|
required this.type,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.volume,
|
|
this.checksum,
|
|
});
|
|
|
|
TrashedAsset copyWith({
|
|
String? id,
|
|
String? name,
|
|
String? volume,
|
|
String? albumId,
|
|
String? checksum,
|
|
AssetType? type,
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
}) {
|
|
return TrashedAsset(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
volume: volume ?? this.volume,
|
|
albumId: albumId ?? this.albumId,
|
|
checksum: checksum ?? this.checksum,
|
|
type: type ?? this.type,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'TrashedAsset('
|
|
'id: $id, '
|
|
'name: $name, '
|
|
'volume: $volume, '
|
|
'albumId: $albumId, '
|
|
'checksum: $checksum, '
|
|
'type: $type, '
|
|
'createdAt: $createdAt, '
|
|
'updatedAt: $updatedAt, '
|
|
')';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is TrashedAsset &&
|
|
runtimeType == other.runtimeType &&
|
|
id == other.id &&
|
|
name == other.name &&
|
|
volume == other.volume &&
|
|
albumId == other.albumId &&
|
|
checksum == other.checksum &&
|
|
type == other.type &&
|
|
createdAt == other.createdAt &&
|
|
updatedAt == other.updatedAt;
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, name, volume, albumId, checksum, type, createdAt, updatedAt);
|
|
}
|