File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ export class PersonRepository implements IPersonRepository {
279
279
faceIdsToRemove : string [ ] ,
280
280
embeddingsToAdd ?: FaceSearchEntity [ ] ,
281
281
) : Promise < void > {
282
- const query = this . faceSearchRepository . createQueryBuilder ( ) . select ( '1' ) ;
282
+ const query = this . faceSearchRepository . createQueryBuilder ( ) . select ( '1' ) . fromDummy ( ) ;
283
283
if ( facesToAdd . length > 0 ) {
284
284
const insertCte = this . assetFaceRepository . createQueryBuilder ( ) . insert ( ) . values ( facesToAdd ) ;
285
285
query . addCommonTableExpression ( insertCte , 'added' ) ;
@@ -296,6 +296,7 @@ export class PersonRepository implements IPersonRepository {
296
296
if ( embeddingsToAdd ?. length ) {
297
297
const embeddingCte = this . faceSearchRepository . createQueryBuilder ( ) . insert ( ) . values ( embeddingsToAdd ) . orIgnore ( ) ;
298
298
query . addCommonTableExpression ( embeddingCte , 'embeddings' ) ;
299
+ query . getQuery ( ) ; // typeorm mixes up parameters without this
299
300
}
300
301
301
302
await query . execute ( ) ;
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ export class PersonService extends BaseService {
325
325
326
326
if ( match && ! mlFaceIds . delete ( match . id ) ) {
327
327
embeddings . push ( { faceId : match . id , embedding } ) ;
328
- } else {
328
+ } else if ( ! match ) {
329
329
const faceId = this . cryptoRepository . randomUUID ( ) ;
330
330
facesToAdd . push ( {
331
331
id : faceId ,
You can’t perform that action at this time.
0 commit comments