1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-03 01:22:44 +01:00
This commit is contained in:
Alex 2025-01-28 14:34:01 -06:00 committed by GitHub
commit fdee6d9a9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions
server/src

View file

@ -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",

View file

@ -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')