mirror of
https://github.com/immich-app/immich.git
synced 2026-05-22 15:02:32 -04:00
289194a356
* feat(mobile): select which local assets to display in timeline * remove album selection chips * refactor: move backup selection to device asset --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
45 lines
1.0 KiB
Dart
45 lines
1.0 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:immich_mobile/modules/backup/models/backup_album.model.dart';
|
|
import 'package:isar/isar.dart';
|
|
|
|
part 'device_asset.g.dart';
|
|
|
|
@Collection()
|
|
class DeviceAsset {
|
|
DeviceAsset({
|
|
required this.id,
|
|
required this.hash,
|
|
this.backupSelection = BackupSelection.none,
|
|
});
|
|
|
|
Id get isarId => Isar.autoIncrement;
|
|
@Index(replace: true, unique: true, type: IndexType.hash)
|
|
String id;
|
|
|
|
@Index(unique: false, type: IndexType.hash)
|
|
List<byte> hash;
|
|
|
|
@enumerated
|
|
BackupSelection backupSelection;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'DeviceAsset(id: $id, hash: $hash, backupSelection: $backupSelection)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(covariant DeviceAsset other) {
|
|
if (identical(this, other)) return true;
|
|
|
|
return other.id == id &&
|
|
listEquals(other.hash, hash) &&
|
|
other.backupSelection == backupSelection;
|
|
}
|
|
|
|
@override
|
|
@ignore
|
|
int get hashCode {
|
|
return id.hashCode ^ hash.hashCode ^ backupSelection.hashCode;
|
|
}
|
|
}
|