fix(server): skip stacked assets in duplicate detection (#16380)

* skip stacked assets in duplicate detection

* update sql

* handle stacking after duplicate detection runs
This commit is contained in:
Mert
2025-02-27 19:16:13 +03:00
committed by GitHub
parent a808b8610e
commit a708649504
8 changed files with 34 additions and 0 deletions

View File

@@ -794,6 +794,7 @@ export class AssetRepository {
.where('assets.duplicateId', 'is not', null)
.where('assets.deletedAt', 'is', null)
.where('assets.isVisible', '=', true)
.where('assets.stackId', 'is', null)
.groupBy('assets.duplicateId'),
)
.with('unique', (qb) =>

View File

@@ -318,6 +318,7 @@ export class SearchRepository {
.where('assets.isVisible', '=', true)
.where('assets.type', '=', type)
.where('assets.id', '!=', asUuid(assetId))
.where('assets.stackId', 'is', null)
.orderBy(sql`smart_search.embedding <=> ${embedding}`)
.limit(64),
)