refactor: handle detect faces job query (#17660)

This commit is contained in:
Daniel Dietzler
2025-04-16 22:52:54 +02:00
committed by GitHub
parent 1bbfacfc09
commit 586a7a173b
5 changed files with 80 additions and 32 deletions

View File

@@ -137,6 +137,18 @@ export class AssetJobRepository {
.executeTakeFirst();
}
@GenerateSql({ params: [DummyValue.UUID] })
getForDetectFacesJob(id: string) {
return this.db
.selectFrom('assets')
.select(['assets.id', 'assets.isVisible'])
.$call(withExifInner)
.select((eb) => withFaces(eb, true))
.select((eb) => withFiles(eb, AssetFileType.PREVIEW))
.where('assets.id', '=', id)
.executeTakeFirst();
}
private storageTemplateAssetQuery() {
return this.db
.selectFrom('assets')