mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): merge facial-recognition and person (#4237)
* move facial recognition service into person service * merge face repository and person repository * fix imports
This commit is contained in:
parent
c3d6d69262
commit
0a22e64799
22 changed files with 556 additions and 661 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { IFaceRepository, IPersonRepository, LoginResponseDto } from '@app/domain';
|
||||
import { IPersonRepository, LoginResponseDto } from '@app/domain';
|
||||
import { AppModule, PersonController } from '@app/immich';
|
||||
import { PersonEntity } from '@app/infra/entities';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
|
|
@ -14,7 +14,6 @@ describe(`${PersonController.name}`, () => {
|
|||
let loginResponse: LoginResponseDto;
|
||||
let accessToken: string;
|
||||
let personRepository: IPersonRepository;
|
||||
let faceRepository: IFaceRepository;
|
||||
let visiblePerson: PersonEntity;
|
||||
let hiddenPerson: PersonEntity;
|
||||
|
||||
|
|
@ -26,7 +25,6 @@ describe(`${PersonController.name}`, () => {
|
|||
app = await moduleFixture.createNestApplication().init();
|
||||
server = app.getHttpServer();
|
||||
personRepository = app.get<IPersonRepository>(IPersonRepository);
|
||||
faceRepository = app.get<IFaceRepository>(IFaceRepository);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
@ -41,7 +39,7 @@ describe(`${PersonController.name}`, () => {
|
|||
name: 'visible_person',
|
||||
thumbnailPath: '/thumbnail/face_asset',
|
||||
});
|
||||
await faceRepository.create({ assetId: faceAsset.id, personId: visiblePerson.id });
|
||||
await personRepository.createFace({ assetId: faceAsset.id, personId: visiblePerson.id });
|
||||
|
||||
hiddenPerson = await personRepository.create({
|
||||
ownerId: loginResponse.userId,
|
||||
|
|
@ -49,7 +47,7 @@ describe(`${PersonController.name}`, () => {
|
|||
isHidden: true,
|
||||
thumbnailPath: '/thumbnail/face_asset',
|
||||
});
|
||||
await faceRepository.create({ assetId: faceAsset.id, personId: hiddenPerson.id });
|
||||
await personRepository.createFace({ assetId: faceAsset.id, personId: hiddenPerson.id });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue