mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(mobile): people sync (#19777)
* feat(mobile): drift people sync * merge main --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
2e63b9d951
commit
7bae49ebd5
30 changed files with 2197 additions and 63 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:convert';
|
||||
|
||||
// Model for a stack stored in the server
|
||||
class Stack {
|
||||
final String id;
|
||||
|
|
@ -32,34 +30,15 @@ class Stack {
|
|||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'id': id,
|
||||
'createdAt': createdAt.millisecondsSinceEpoch,
|
||||
'updatedAt': updatedAt.millisecondsSinceEpoch,
|
||||
'ownerId': ownerId,
|
||||
'primaryAssetId': primaryAssetId,
|
||||
};
|
||||
}
|
||||
|
||||
factory Stack.fromMap(Map<String, dynamic> map) {
|
||||
return Stack(
|
||||
id: map['id'] as String,
|
||||
createdAt: DateTime.fromMillisecondsSinceEpoch(map['createdAt'] as int),
|
||||
updatedAt: DateTime.fromMillisecondsSinceEpoch(map['updatedAt'] as int),
|
||||
ownerId: map['ownerId'] as String,
|
||||
primaryAssetId: map['primaryAssetId'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Stack.fromJson(String source) =>
|
||||
Stack.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Stack(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, ownerId: $ownerId, primaryAssetId: $primaryAssetId)';
|
||||
return '''Stack {
|
||||
id: $id,
|
||||
createdAt: $createdAt,
|
||||
updatedAt: $updatedAt,
|
||||
ownerId: $ownerId,
|
||||
primaryAssetId: $primaryAssetId
|
||||
}''';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue