mirror of
https://github.com/immich-app/immich.git
synced 2025-02-03 01:22:44 +01:00
Merge 8c24bb7014
into da580d4685
This commit is contained in:
commit
fdee6d9a9f
2 changed files with 6 additions and 1 deletions
server/src
|
@ -59,12 +59,14 @@ select
|
|||
json_agg("res") as "assets"
|
||||
from
|
||||
"res"
|
||||
where
|
||||
"localDateTime" >= $8
|
||||
group by
|
||||
("localDateTime" at time zone 'UTC')::date
|
||||
order by
|
||||
("localDateTime" at time zone 'UTC')::date desc
|
||||
limit
|
||||
$8
|
||||
$9
|
||||
|
||||
-- AssetRepository.getByIds
|
||||
select
|
||||
|
@ -258,6 +260,7 @@ with
|
|||
where
|
||||
"assets"."deletedAt" is null
|
||||
and "assets"."isVisible" = $2
|
||||
and "assets"."localDateTime" >= $3
|
||||
)
|
||||
select
|
||||
"timeBucket",
|
||||
|
|
|
@ -137,6 +137,7 @@ export class AssetRepository implements IAssetRepository {
|
|||
),
|
||||
)
|
||||
.select((eb) => eb.fn.jsonAgg(eb.table('res')).as('assets'))
|
||||
.where('localDateTime', '>=', new Date('1850-01-01'))
|
||||
.groupBy(sql`("localDateTime" at time zone 'UTC')::date`)
|
||||
.orderBy(sql`("localDateTime" at time zone 'UTC')::date`, 'desc')
|
||||
.limit(10)
|
||||
|
@ -584,6 +585,7 @@ export class AssetRepository implements IAssetRepository {
|
|||
.$if(!!options.isTrashed, (qb) => qb.where('assets.status', '!=', AssetStatus.DELETED))
|
||||
.where('assets.deletedAt', options.isTrashed ? 'is not' : 'is', null)
|
||||
.where('assets.isVisible', '=', true)
|
||||
.where('assets.localDateTime', '>=', new Date('1850-01-01'))
|
||||
.$if(!!options.albumId, (qb) =>
|
||||
qb
|
||||
.innerJoin('albums_assets_assets', 'assets.id', 'albums_assets_assets.assetsId')
|
||||
|
|
Loading…
Reference in a new issue