mirror of
https://github.com/immich-app/immich.git
synced 2025-05-23 17:03:01 -04:00
queue assets without detected faces
This commit is contained in:
parent
fdc8f91b18
commit
930961825e
@ -140,8 +140,7 @@ export class AssetJobRepository {
|
||||
.selectFrom('assets')
|
||||
.where('assets.visibility', '!=', AssetVisibility.HIDDEN)
|
||||
.where('assets.deletedAt', 'is', null)
|
||||
.innerJoin('asset_job_status as job_status', 'assetId', 'assets.id')
|
||||
.where('job_status.previewAt', 'is not', null);
|
||||
.innerJoin('asset_job_status as job_status', 'assetId', 'assets.id');
|
||||
}
|
||||
|
||||
@GenerateSql({ params: [], stream: true })
|
||||
@ -335,8 +334,13 @@ export class AssetJobRepository {
|
||||
|
||||
@GenerateSql({ params: [], stream: true })
|
||||
streamForDetectFacesJob(force?: boolean) {
|
||||
return this.assetsWithPreviews()
|
||||
.$if(!force, (qb) => qb.where('job_status.facesRecognizedAt', 'is', null))
|
||||
return this.db
|
||||
.selectFrom('assets')
|
||||
.$if(!force, (qb) =>
|
||||
qb.where((eb) =>
|
||||
eb.not(eb.exists(eb.selectFrom('asset_faces').whereRef('asset_faces.assetId', '=', 'assets.id'))),
|
||||
),
|
||||
)
|
||||
.select(['assets.id'])
|
||||
.orderBy('assets.createdAt', 'desc')
|
||||
.stream();
|
||||
|
Loading…
x
Reference in New Issue
Block a user