mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: album start/end dates on shared links (#21268)
This commit is contained in:
parent
840e43430c
commit
acfd40b77a
4 changed files with 83 additions and 3 deletions
|
|
@ -38,7 +38,11 @@ from
|
|||
select
|
||||
"album".*,
|
||||
coalesce(
|
||||
json_agg("assets") filter (
|
||||
json_agg(
|
||||
"assets"
|
||||
order by
|
||||
"assets"."fileCreatedAt" asc
|
||||
) filter (
|
||||
where
|
||||
"assets"."id" is not null
|
||||
),
|
||||
|
|
|
|||
|
|
@ -86,7 +86,16 @@ export class SharedLinkRepository {
|
|||
(join) => join.onTrue(),
|
||||
)
|
||||
.select((eb) =>
|
||||
eb.fn.coalesce(eb.fn.jsonAgg('assets').filterWhere('assets.id', 'is not', null), sql`'[]'`).as('assets'),
|
||||
eb.fn
|
||||
.coalesce(
|
||||
eb.fn
|
||||
.jsonAgg('assets')
|
||||
.orderBy('assets.fileCreatedAt', 'asc')
|
||||
.filterWhere('assets.id', 'is not', null),
|
||||
|
||||
sql`'[]'`,
|
||||
)
|
||||
.as('assets'),
|
||||
)
|
||||
.select((eb) => eb.fn.toJson('owner').as('owner'))
|
||||
.groupBy(['album.id', sql`"owner".*`])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue