mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 20:25:32 -04:00
fix(server): avoid getting timebucket in the future (#4540)
This commit is contained in:
parent
2ec63f7914
commit
cfec6a8fdb
@ -480,7 +480,6 @@ export class AssetRepository implements IAssetRepository {
|
|||||||
|
|
||||||
getTimeBuckets(options: TimeBucketOptions): Promise<TimeBucketItem[]> {
|
getTimeBuckets(options: TimeBucketOptions): Promise<TimeBucketItem[]> {
|
||||||
const truncated = dateTrunc(options);
|
const truncated = dateTrunc(options);
|
||||||
|
|
||||||
return this.getBuilder(options)
|
return this.getBuilder(options)
|
||||||
.select(`COUNT(asset.id)::int`, 'count')
|
.select(`COUNT(asset.id)::int`, 'count')
|
||||||
.addSelect(truncated, 'timeBucket')
|
.addSelect(truncated, 'timeBucket')
|
||||||
@ -508,6 +507,7 @@ export class AssetRepository implements IAssetRepository {
|
|||||||
let builder = this.repository
|
let builder = this.repository
|
||||||
.createQueryBuilder('asset')
|
.createQueryBuilder('asset')
|
||||||
.where('asset.isVisible = true')
|
.where('asset.isVisible = true')
|
||||||
|
.andWhere('asset.fileCreatedAt < NOW()')
|
||||||
.leftJoinAndSelect('asset.exifInfo', 'exifInfo');
|
.leftJoinAndSelect('asset.exifInfo', 'exifInfo');
|
||||||
|
|
||||||
if (albumId) {
|
if (albumId) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user