mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	fix(server): use fileCreatedAt in buckets (#4354)
This commit is contained in:
		
							parent
							
								
									beb92e8ffb
								
							
						
					
					
						commit
						81009c17bf
					
				@ -474,7 +474,7 @@ export class AssetRepository implements IAssetRepository {
 | 
				
			|||||||
  getByTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise<AssetEntity[]> {
 | 
					  getByTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise<AssetEntity[]> {
 | 
				
			||||||
    const truncateValue = truncateMap[options.size];
 | 
					    const truncateValue = truncateMap[options.size];
 | 
				
			||||||
    return this.getBuilder(options)
 | 
					    return this.getBuilder(options)
 | 
				
			||||||
      .andWhere(`date_trunc('${truncateValue}', "localDateTime") = :timeBucket`, { timeBucket })
 | 
					      .andWhere(`date_trunc('${truncateValue}', "fileCreatedAt") = :timeBucket`, { timeBucket })
 | 
				
			||||||
      .orderBy(`date_trunc('day', "localDateTime")`, 'DESC')
 | 
					      .orderBy(`date_trunc('day', "localDateTime")`, 'DESC')
 | 
				
			||||||
      .addOrderBy('asset.fileCreatedAt', 'DESC')
 | 
					      .addOrderBy('asset.fileCreatedAt', 'DESC')
 | 
				
			||||||
      .getMany();
 | 
					      .getMany();
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								server/test/assets
									
									
									
									
									
										Submodule
									
								
							
							
								
								
								
								
								
								
									
									
								
							
						
						
									
										1
									
								
								server/test/assets
									
									
									
									
									
										Submodule
									
								
							@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					Subproject commit 9e6e1bcc245e0ae0285bb596faf310ead851fac6
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user