mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: small face tests (#26340)
This commit is contained in:
@@ -197,13 +197,9 @@ export class PersonService extends BaseService {
|
||||
let faceId: string | undefined = undefined;
|
||||
if (assetId) {
|
||||
await this.requireAccess({ auth, permission: Permission.AssetRead, ids: [assetId] });
|
||||
const [face] = await this.personRepository.getFacesByIds([{ personId: id, assetId }]);
|
||||
const face = await this.personRepository.getForFeatureFaceUpdate({ personId: id, assetId });
|
||||
if (!face) {
|
||||
throw new BadRequestException('Invalid assetId for feature face');
|
||||
}
|
||||
|
||||
if (face.asset.isOffline) {
|
||||
throw new BadRequestException('An offline asset cannot be used for feature face');
|
||||
throw new BadRequestException('Invalid assetId for feature face or asset is offline');
|
||||
}
|
||||
|
||||
faceId = face.id;
|
||||
|
||||
Reference in New Issue
Block a user