mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(server): queueing for duplicate detection (#18380)
* fix queueing * update tests
This commit is contained in:
parent
0d773af6c3
commit
a6a4dfcfd3
4 changed files with 18 additions and 70 deletions
|
|
@ -8,30 +8,14 @@ select
|
|||
"duplicateId",
|
||||
"stackId",
|
||||
"visibility",
|
||||
"smart_search"."embedding",
|
||||
(
|
||||
select
|
||||
coalesce(json_agg(agg), '[]')
|
||||
from
|
||||
(
|
||||
select
|
||||
"asset_files"."id",
|
||||
"asset_files"."path",
|
||||
"asset_files"."type"
|
||||
from
|
||||
"asset_files"
|
||||
where
|
||||
"asset_files"."assetId" = "assets"."id"
|
||||
and "asset_files"."type" = $1
|
||||
) as agg
|
||||
) as "files"
|
||||
"smart_search"."embedding"
|
||||
from
|
||||
"assets"
|
||||
left join "smart_search" on "assets"."id" = "smart_search"."assetId"
|
||||
where
|
||||
"assets"."id" = $2::uuid
|
||||
"assets"."id" = $1::uuid
|
||||
limit
|
||||
$3
|
||||
$2
|
||||
|
||||
-- AssetJobRepository.getForSidecarWriteJob
|
||||
select
|
||||
|
|
@ -199,18 +183,11 @@ select
|
|||
"assets"."id"
|
||||
from
|
||||
"assets"
|
||||
inner join "smart_search" on "assets"."id" = "smart_search"."assetId"
|
||||
inner join "asset_job_status" as "job_status" on "assetId" = "assets"."id"
|
||||
where
|
||||
"assets"."visibility" != $1
|
||||
and "assets"."deletedAt" is null
|
||||
and "job_status"."previewAt" is not null
|
||||
and not exists (
|
||||
select
|
||||
from
|
||||
"smart_search"
|
||||
where
|
||||
"assetId" = "assets"."id"
|
||||
)
|
||||
and "job_status"."duplicatesDetectedAt" is null
|
||||
|
||||
-- AssetJobRepository.streamForEncodeClip
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue