fix(server): avoid getting timebucket in the future (#4540)

This commit is contained in:
Alex 2023-10-19 13:52:37 -05:00 committed by GitHub
parent 2ec63f7914
commit cfec6a8fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -480,7 +480,6 @@ export class AssetRepository implements IAssetRepository {
getTimeBuckets(options: TimeBucketOptions): Promise<TimeBucketItem[]> {
const truncated = dateTrunc(options);
return this.getBuilder(options)
.select(`COUNT(asset.id)::int`, 'count')
.addSelect(truncated, 'timeBucket')
@ -508,6 +507,7 @@ export class AssetRepository implements IAssetRepository {
let builder = this.repository
.createQueryBuilder('asset')
.where('asset.isVisible = true')
.andWhere('asset.fileCreatedAt < NOW()')
.leftJoinAndSelect('asset.exifInfo', 'exifInfo');
if (albumId) {