From cfec6a8fdb55a92ab2a1c9160bbe671e77796975 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 19 Oct 2023 13:52:37 -0500 Subject: [PATCH] fix(server): avoid getting timebucket in the future (#4540) --- server/src/infra/repositories/asset.repository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/infra/repositories/asset.repository.ts b/server/src/infra/repositories/asset.repository.ts index f6f58b9268..55bf39b1fe 100644 --- a/server/src/infra/repositories/asset.repository.ts +++ b/server/src/infra/repositories/asset.repository.ts @@ -480,7 +480,6 @@ export class AssetRepository implements IAssetRepository { getTimeBuckets(options: TimeBucketOptions): Promise { 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) {