1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

automatically removing persons with zero photos

This commit is contained in:
Patrik J. Braun 2019-02-15 13:26:01 -05:00
parent 00dfcc399d
commit 6b549262f6

View File

@ -111,6 +111,13 @@ export class PersonManager implements IPersonManager {
const connection = await SQLConnection.getConnection();
await connection.query('update person_entry set count = ' +
' (select COUNT(1) from face_region_entry where face_region_entry.personId = person_entry.id)');
// remove persons without photo
await connection.getRepository(PersonEntry)
.createQueryBuilder()
.where('count = 0')
.delete()
.execute();
}
}