diff --git a/server/src/queries/asset.job.repository.sql b/server/src/queries/asset.job.repository.sql index 2301408ffe..3d47b7517e 100644 --- a/server/src/queries/asset.job.repository.sql +++ b/server/src/queries/asset.job.repository.sql @@ -184,7 +184,7 @@ select from "assets" inner join "smart_search" on "assets"."id" = "smart_search"."assetId" - inner join "asset_job_status" as "job_status" on "assetId" = "assets"."id" + inner join "asset_job_status" as "job_status" on "job_status"."assetId" = "assets"."id" where "assets"."visibility" != $1 and "assets"."deletedAt" is null diff --git a/server/src/repositories/asset-job.repository.ts b/server/src/repositories/asset-job.repository.ts index b9ce52962c..6f86edaaa1 100644 --- a/server/src/repositories/asset-job.repository.ts +++ b/server/src/repositories/asset-job.repository.ts @@ -145,7 +145,7 @@ export class AssetJobRepository { .innerJoin('smart_search', 'assets.id', 'smart_search.assetId') .$if(!force, (qb) => qb - .innerJoin('asset_job_status as job_status', 'assetId', 'assets.id') + .innerJoin('asset_job_status as job_status', 'job_status.assetId', 'assets.id') .where('job_status.duplicatesDetectedAt', 'is', null), ) .stream();