mirror of
https://github.com/immich-app/immich.git
synced 2025-12-24 01:11:32 +03:00
fix(server): only asset owner should see favorite status (#20654)
* fix: Any asset update disables isFavorite action in GUI. Only owner of asset in album should see favorited image. * Fix unit tests * Fix formatting * better query, add medium test * update sql --------- Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
This commit is contained in:
@@ -296,7 +296,8 @@ with
|
||||
"asset"."duration",
|
||||
"asset"."id",
|
||||
"asset"."visibility",
|
||||
"asset"."isFavorite",
|
||||
asset."isFavorite"
|
||||
and asset."ownerId" = $1 as "isFavorite",
|
||||
asset.type = 'IMAGE' as "isImage",
|
||||
asset."deletedAt" is not null as "isTrashed",
|
||||
"asset"."livePhotoVideoId",
|
||||
@@ -341,14 +342,14 @@ with
|
||||
where
|
||||
"stacked"."stackId" = "asset"."stackId"
|
||||
and "stacked"."deletedAt" is null
|
||||
and "stacked"."visibility" = $1
|
||||
and "stacked"."visibility" = $2
|
||||
group by
|
||||
"stacked"."stackId"
|
||||
) as "stacked_assets" on true
|
||||
where
|
||||
"asset"."deletedAt" is null
|
||||
and "asset"."visibility" in ('archive', 'timeline')
|
||||
and date_trunc('MONTH', "localDateTime" AT TIME ZONE 'UTC') AT TIME ZONE 'UTC' = $2
|
||||
and date_trunc('MONTH', "localDateTime" AT TIME ZONE 'UTC') AT TIME ZONE 'UTC' = $3
|
||||
and not exists (
|
||||
select
|
||||
from
|
||||
|
||||
Reference in New Issue
Block a user