mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Add equals and hashcode to Asset
This commit is contained in:
parent
1633af7af6
commit
0deb8f4090
1 changed files with 9 additions and 0 deletions
|
|
@ -50,6 +50,15 @@ class Asset {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(other) {
|
||||||
|
if (other is! Asset) return false;
|
||||||
|
return id == other.id && isLocal == other.isLocal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => id.hashCode;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
if (isLocal) {
|
if (isLocal) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue