From 81009c17bf6c7c47d0511da42a9f7fff233147b2 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Thu, 5 Oct 2023 15:26:42 +0200 Subject: [PATCH] fix(server): use fileCreatedAt in buckets (#4354) --- server/src/infra/repositories/asset.repository.ts | 2 +- server/test/assets | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 server/test/assets diff --git a/server/src/infra/repositories/asset.repository.ts b/server/src/infra/repositories/asset.repository.ts index e2cfb28de5..ec7e69aee2 100644 --- a/server/src/infra/repositories/asset.repository.ts +++ b/server/src/infra/repositories/asset.repository.ts @@ -474,7 +474,7 @@ export class AssetRepository implements IAssetRepository { getByTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise { const truncateValue = truncateMap[options.size]; return this.getBuilder(options) - .andWhere(`date_trunc('${truncateValue}', "localDateTime") = :timeBucket`, { timeBucket }) + .andWhere(`date_trunc('${truncateValue}', "fileCreatedAt") = :timeBucket`, { timeBucket }) .orderBy(`date_trunc('day', "localDateTime")`, 'DESC') .addOrderBy('asset.fileCreatedAt', 'DESC') .getMany(); diff --git a/server/test/assets b/server/test/assets new file mode 160000 index 0000000000..9e6e1bcc24 --- /dev/null +++ b/server/test/assets @@ -0,0 +1 @@ +Subproject commit 9e6e1bcc245e0ae0285bb596faf310ead851fac6