mirror of
https://github.com/immich-app/immich.git
synced 2026-03-01 10:08:42 +03:00
fix(server): "all" button for facial recognition deleting faces instead of unassigning them (#13042)
* unassign faces instead of deleting them * formatting
This commit is contained in:
@@ -276,16 +276,6 @@ export class PersonService {
|
||||
this.logger.debug(`Deleted ${people.length} people`);
|
||||
}
|
||||
|
||||
private async deleteAllPeople() {
|
||||
const personPagination = usePagination(JOBS_ASSET_PAGINATION_SIZE, (pagination) =>
|
||||
this.repository.getAll({ ...pagination, skip: 0 }),
|
||||
);
|
||||
|
||||
for await (const people of personPagination) {
|
||||
await this.delete(people); // deletes thumbnails too
|
||||
}
|
||||
}
|
||||
|
||||
async handlePersonCleanup(): Promise<JobStatus> {
|
||||
const people = await this.repository.getAllWithoutFaces();
|
||||
await this.delete(people);
|
||||
@@ -299,7 +289,7 @@ export class PersonService {
|
||||
}
|
||||
|
||||
if (force) {
|
||||
await this.repository.deleteAllFaces({ sourceType: SourceType.MACHINE_LEARNING });
|
||||
await this.repository.deleteFaces({ sourceType: SourceType.MACHINE_LEARNING });
|
||||
await this.handlePersonCleanup();
|
||||
}
|
||||
|
||||
@@ -407,7 +397,7 @@ export class PersonService {
|
||||
const { waiting } = await this.jobRepository.getJobCounts(QueueName.FACIAL_RECOGNITION);
|
||||
|
||||
if (force) {
|
||||
await this.repository.deleteAllFaces({ sourceType: SourceType.MACHINE_LEARNING });
|
||||
await this.repository.unassignFaces({ sourceType: SourceType.MACHINE_LEARNING });
|
||||
await this.handlePersonCleanup();
|
||||
} else if (waiting) {
|
||||
this.logger.debug(
|
||||
|
||||
Reference in New Issue
Block a user