refactor(server): remove face, person and face search entities (#17535)

* remove face, person and face search entities

update tests and mappers

check if face relation exists

update sql

unused imports

* pr feedback

generate sql, remove unused imports
This commit is contained in:
Mert 2025-04-11 14:44:45 -04:00 committed by GitHub
parent ae6653392e
commit 25f2b9602f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 384 additions and 322 deletions

View file

@ -2,7 +2,6 @@ import { randomUUID } from 'node:crypto';
import { dirname, join, resolve } from 'node:path';
import { APP_MEDIA_LOCATION } from 'src/constants';
import { AssetEntity } from 'src/entities/asset.entity';
import { PersonEntity } from 'src/entities/person.entity';
import { AssetFileType, AssetPathType, ImageFormat, PathType, PersonPathType, StorageFolder } from 'src/enum';
import { AssetRepository } from 'src/repositories/asset.repository';
import { ConfigRepository } from 'src/repositories/config.repository';
@ -85,7 +84,7 @@ export class StorageCore {
return join(APP_MEDIA_LOCATION, folder);
}
static getPersonThumbnailPath(person: PersonEntity) {
static getPersonThumbnailPath(person: { id: string; ownerId: string }) {
return StorageCore.getNestedPath(StorageFolder.THUMBNAILS, person.ownerId, `${person.id}.jpeg`);
}
@ -135,7 +134,7 @@ export class StorageCore {
});
}
async movePersonFile(person: PersonEntity, pathType: PersonPathType) {
async movePersonFile(person: { id: string; ownerId: string; thumbnailPath: string }, pathType: PersonPathType) {
const { id: entityId, thumbnailPath } = person;
switch (pathType) {
case PersonPathType.FACE: {