mirror of
https://github.com/immich-app/immich.git
synced 2025-12-29 17:25:00 +03:00
fix(server): tighten asset visibility (#18699)
* tighten visibility * update sql * elevated access util function * fix potential sync issue * include in user stats * include hidden assets in size usage * filter visibility in search duplicates query * stack visibility
This commit is contained in:
@@ -102,23 +102,23 @@ with
|
||||
"assets"
|
||||
inner join "smart_search" on "assets"."id" = "smart_search"."assetId"
|
||||
where
|
||||
"assets"."ownerId" = any ($2::uuid[])
|
||||
"assets"."visibility" in ('archive', 'timeline')
|
||||
and "assets"."ownerId" = any ($2::uuid[])
|
||||
and "assets"."deletedAt" is null
|
||||
and "assets"."visibility" != $3
|
||||
and "assets"."type" = $4
|
||||
and "assets"."id" != $5::uuid
|
||||
and "assets"."type" = $3
|
||||
and "assets"."id" != $4::uuid
|
||||
and "assets"."stackId" is null
|
||||
order by
|
||||
"distance"
|
||||
limit
|
||||
$6
|
||||
$5
|
||||
)
|
||||
select
|
||||
*
|
||||
from
|
||||
"cte"
|
||||
where
|
||||
"cte"."distance" <= $7
|
||||
"cte"."distance" <= $6
|
||||
commit
|
||||
|
||||
-- SearchRepository.searchFaces
|
||||
@@ -241,7 +241,7 @@ from
|
||||
inner join "assets" on "assets"."id" = "exif"."assetId"
|
||||
where
|
||||
"ownerId" = any ($1::uuid[])
|
||||
and "visibility" != $2
|
||||
and "visibility" = $2
|
||||
and "deletedAt" is null
|
||||
and "state" is not null
|
||||
|
||||
@@ -253,7 +253,7 @@ from
|
||||
inner join "assets" on "assets"."id" = "exif"."assetId"
|
||||
where
|
||||
"ownerId" = any ($1::uuid[])
|
||||
and "visibility" != $2
|
||||
and "visibility" = $2
|
||||
and "deletedAt" is null
|
||||
and "city" is not null
|
||||
|
||||
@@ -265,7 +265,7 @@ from
|
||||
inner join "assets" on "assets"."id" = "exif"."assetId"
|
||||
where
|
||||
"ownerId" = any ($1::uuid[])
|
||||
and "visibility" != $2
|
||||
and "visibility" = $2
|
||||
and "deletedAt" is null
|
||||
and "make" is not null
|
||||
|
||||
@@ -277,6 +277,6 @@ from
|
||||
inner join "assets" on "assets"."id" = "exif"."assetId"
|
||||
where
|
||||
"ownerId" = any ($1::uuid[])
|
||||
and "visibility" != $2
|
||||
and "visibility" = $2
|
||||
and "deletedAt" is null
|
||||
and "model" is not null
|
||||
|
||||
Reference in New Issue
Block a user