feat(web): use time buckets of person detail page (3) (#3557)

* feat: add personId to time bucket endpoints

* chore: open api

* feat(web): time bucket on person detail page
This commit is contained in:
Jason Rasmussen
2023-08-05 09:58:52 -04:00
committed by GitHub
parent 68b5202730
commit ff32506c5e
19 changed files with 402 additions and 316 deletions

View File

@@ -386,7 +386,7 @@ export class AssetRepository implements IAssetRepository {
}
private getBuilder(userId: string, options: TimeBucketOptions) {
const { isArchived, isFavorite, albumId } = options;
const { isArchived, isFavorite, albumId, personId } = options;
let builder = this.repository
.createQueryBuilder('asset')
@@ -406,6 +406,13 @@ export class AssetRepository implements IAssetRepository {
builder = builder.andWhere('asset.isFavorite = :isFavorite', { isFavorite });
}
if (personId !== undefined) {
builder = builder
.innerJoin('asset.faces', 'faces')
.innerJoin('faces.person', 'person')
.andWhere('person.id = :personId', { personId });
}
return builder;
}
}