2025-07-23 01:17:52 +08:00
|
|
|
import 'package:drift/drift.dart';
|
|
|
|
|
import 'package:immich_mobile/domain/models/asset_face.model.dart';
|
|
|
|
|
import 'package:immich_mobile/infrastructure/entities/asset_face.entity.drift.dart';
|
|
|
|
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
|
|
|
|
|
|
|
|
|
class DriftAssetFaceRepository extends DriftDatabaseRepository {
|
|
|
|
|
final Drift _db;
|
|
|
|
|
const DriftAssetFaceRepository(this._db) : super(_db);
|
|
|
|
|
|
|
|
|
|
Future<List<AssetFace>> getAll() {
|
2025-07-25 08:07:22 +05:30
|
|
|
return _db.assetFaceEntity.select().map((assetFace) => assetFace.toDto()).get();
|
2025-07-23 01:17:52 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension on AssetFaceEntityData {
|
|
|
|
|
AssetFace toDto() {
|
|
|
|
|
return AssetFace(
|
|
|
|
|
id: id,
|
|
|
|
|
assetId: assetId,
|
|
|
|
|
personId: personId,
|
|
|
|
|
imageWidth: imageWidth,
|
|
|
|
|
imageHeight: imageHeight,
|
|
|
|
|
boundingBoxX1: boundingBoxX1,
|
|
|
|
|
boundingBoxY1: boundingBoxY1,
|
|
|
|
|
boundingBoxX2: boundingBoxX2,
|
|
|
|
|
boundingBoxY2: boundingBoxY2,
|
|
|
|
|
sourceType: sourceType,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|