mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 17:24:58 +03:00
fix: prevent an offline asset from being used as a person feature photo (#21278)
This commit is contained in:
@@ -42,7 +42,6 @@ describe(MediaService.name, () => {
|
||||
mocks.assetJob.streamForThumbnailJob.mockReturnValue(makeStream([assetStub.image]));
|
||||
|
||||
mocks.person.getAll.mockReturnValue(makeStream([personStub.newThumbnail]));
|
||||
mocks.person.getFacesByIds.mockResolvedValue([faceStub.face1]);
|
||||
|
||||
await sut.handleQueueGenerateThumbnails({ force: true });
|
||||
|
||||
|
||||
@@ -197,6 +197,10 @@ export class PersonService extends BaseService {
|
||||
throw new BadRequestException('Invalid assetId for feature face');
|
||||
}
|
||||
|
||||
if (face.asset.isOffline) {
|
||||
throw new BadRequestException('An offline asset cannot be used for feature face');
|
||||
}
|
||||
|
||||
faceId = face.id;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user