mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 21:36:46 +01:00
3432b4625f
* Regenerate missing person thumbnails * Check for empty string instead of zero length * Remember asset used as person face * Define entity relation between person and asset via faceAssetId * Typo * Fix entity relation * Tests * Tests * Fix code formatting * Fix import path * Fix migration * format * Fix entity and migration * Linting * Remove unneeded cast * Conventions * Simplify queries * Simplify queries * Remove unneeded typings from entity * Remove unneeded cast --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import { AssetFaceId } from '@app/domain';
|
|
import { AssetEntity, AssetFaceEntity, PersonEntity } from '@app/infra/entities';
|
|
export const IPersonRepository = 'IPersonRepository';
|
|
|
|
export interface PersonSearchOptions {
|
|
minimumFaceCount: number;
|
|
withHidden: boolean;
|
|
}
|
|
|
|
export interface UpdateFacesData {
|
|
oldPersonId: string;
|
|
newPersonId: string;
|
|
}
|
|
|
|
export interface IPersonRepository {
|
|
getAll(): Promise<PersonEntity[]>;
|
|
getAllWithoutThumbnail(): Promise<PersonEntity[]>;
|
|
getAllForUser(userId: string, options: PersonSearchOptions): Promise<PersonEntity[]>;
|
|
getAllWithoutFaces(): Promise<PersonEntity[]>;
|
|
getById(userId: string, personId: string): Promise<PersonEntity | null>;
|
|
|
|
getAssets(userId: string, personId: string): Promise<AssetEntity[]>;
|
|
prepareReassignFaces(data: UpdateFacesData): Promise<string[]>;
|
|
reassignFaces(data: UpdateFacesData): Promise<number>;
|
|
|
|
create(entity: Partial<PersonEntity>): Promise<PersonEntity>;
|
|
update(entity: Partial<PersonEntity>): Promise<PersonEntity>;
|
|
delete(entity: PersonEntity): Promise<PersonEntity | null>;
|
|
deleteAll(): Promise<number>;
|
|
|
|
getFaceById(payload: AssetFaceId): Promise<AssetFaceEntity | null>;
|
|
getRandomFace(personId: string): Promise<AssetFaceEntity | null>;
|
|
}
|