feat: people page/sheet/detail (#20309)

This commit is contained in:
Alex
2025-07-29 22:07:53 -05:00
committed by GitHub
parent 268b411a6f
commit 29f16c6a47
34 changed files with 1562 additions and 97 deletions

View File

@@ -91,7 +91,7 @@ class PersonDto {
}
// Model for a person stored in the server
class Person {
class DriftPerson {
final String id;
final DateTime createdAt;
final DateTime updatedAt;
@@ -103,7 +103,7 @@ class Person {
final String? color;
final DateTime? birthDate;
const Person({
const DriftPerson({
required this.id,
required this.createdAt,
required this.updatedAt,
@@ -116,7 +116,7 @@ class Person {
this.birthDate,
});
Person copyWith({
DriftPerson copyWith({
String? id,
DateTime? createdAt,
DateTime? updatedAt,
@@ -128,7 +128,7 @@ class Person {
String? color,
DateTime? birthDate,
}) {
return Person(
return DriftPerson(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
@@ -159,7 +159,7 @@ class Person {
}
@override
bool operator ==(covariant Person other) {
bool operator ==(covariant DriftPerson other) {
if (identical(this, other)) return true;
return other.id == id &&

View File

@@ -0,0 +1,30 @@
import 'dart:async';
import 'package:immich_mobile/domain/models/person.model.dart';
import 'package:immich_mobile/infrastructure/repositories/people.repository.dart';
import 'package:immich_mobile/repositories/person_api.repository.dart';
class DriftPeopleService {
final DriftPeopleRepository _repository;
final PersonApiRepository _personApiRepository;
const DriftPeopleService(this._repository, this._personApiRepository);
Future<List<DriftPerson>> getAssetPeople(String assetId) {
return _repository.getAssetPeople(assetId);
}
Future<List<DriftPerson>> getAllPeople() {
return _repository.getAllPeople();
}
Future<int> updateName(String personId, String name) async {
await _personApiRepository.update(personId, name: name);
return _repository.updateName(personId, name);
}
Future<int> updateBrithday(String personId, DateTime birthday) async {
await _personApiRepository.update(personId, birthday: birthday);
return _repository.updateBirthday(personId, birthday);
}
}

View File

@@ -53,6 +53,9 @@ class TimelineFactory {
TimelineService place(String place) => TimelineService(_timelineRepository.place(place, groupBy));
TimelineService person(String userId, String personId) =>
TimelineService(_timelineRepository.person(userId, personId, groupBy));
TimelineService fromAssets(List<BaseAsset> assets) => TimelineService(_timelineRepository.fromAssets(assets));
}