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:
parent
00dfcc399d
commit
6b549262f6
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user