feat: hide hidden person from memories (#20877)

* hide hidden person from memories

* clean up

* fix united test

* clean up

* moved sql to inline, rebased

* clean up

* clean up again

* chore: sync sql

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
sakshamchawla 2026-05-07 15:54:26 -04:00 committed by GitHub
parent 6050526360
commit e2ec04e86c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 13 deletions

View file

@ -42,6 +42,16 @@ select
"memory_asset"."memoriesId" = "memory"."id"
and "asset"."visibility" = 'timeline'
and "asset"."deletedAt" is null
and not exists (
select
$1 as "one"
from
"asset_face"
inner join "person" on "person"."id" = "asset_face"."personId"
where
"asset_face"."assetId" = "asset"."id"
and "person"."isHidden" = $2
)
order by
"asset"."fileCreatedAt" asc
) as agg
@ -51,7 +61,7 @@ from
"memory"
where
"deletedAt" is null
and "ownerId" = $1
and "ownerId" = $3
order by
"memoryAt" desc
@ -71,6 +81,16 @@ select
"memory_asset"."memoriesId" = "memory"."id"
and "asset"."visibility" = 'timeline'
and "asset"."deletedAt" is null
and not exists (
select
$1 as "one"
from
"asset_face"
inner join "person" on "person"."id" = "asset_face"."personId"
where
"asset_face"."assetId" = "asset"."id"
and "person"."isHidden" = $2
)
order by
"asset"."fileCreatedAt" asc
) as agg
@ -81,14 +101,14 @@ from
where
(
"showAt" is null
or "showAt" <= $1
or "showAt" <= $3
)
and (
"hideAt" is null
or "hideAt" >= $2
or "hideAt" >= $4
)
and "deletedAt" is null
and "ownerId" = $3
and "ownerId" = $5
order by
"memoryAt" desc