mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix: don't show comments or likes for trashed assets (#19113)
This commit is contained in:
parent
bedcf50196
commit
5dd3a6e13f
@ -23,9 +23,9 @@ from
|
|||||||
) as "dummy"
|
) as "dummy"
|
||||||
) as "user" on true
|
) as "user" on true
|
||||||
left join "assets" on "assets"."id" = "activity"."assetId"
|
left join "assets" on "assets"."id" = "activity"."assetId"
|
||||||
and "assets"."deletedAt" is null
|
|
||||||
where
|
where
|
||||||
"activity"."albumId" = $1
|
"activity"."albumId" = $1
|
||||||
|
and "assets"."deletedAt" is null
|
||||||
order by
|
order by
|
||||||
"activity"."createdAt" asc
|
"activity"."createdAt" asc
|
||||||
|
|
||||||
|
@ -36,12 +36,13 @@ export class ActivityRepository {
|
|||||||
(join) => join.onTrue(),
|
(join) => join.onTrue(),
|
||||||
)
|
)
|
||||||
.select((eb) => eb.fn.toJson('user').as('user'))
|
.select((eb) => eb.fn.toJson('user').as('user'))
|
||||||
.leftJoin('assets', (join) => join.onRef('assets.id', '=', 'activity.assetId').on('assets.deletedAt', 'is', null))
|
.leftJoin('assets', 'assets.id', 'activity.assetId')
|
||||||
.$if(!!userId, (qb) => qb.where('activity.userId', '=', userId!))
|
.$if(!!userId, (qb) => qb.where('activity.userId', '=', userId!))
|
||||||
.$if(assetId === null, (qb) => qb.where('assetId', 'is', null))
|
.$if(assetId === null, (qb) => qb.where('assetId', 'is', null))
|
||||||
.$if(!!assetId, (qb) => qb.where('activity.assetId', '=', assetId!))
|
.$if(!!assetId, (qb) => qb.where('activity.assetId', '=', assetId!))
|
||||||
.$if(!!albumId, (qb) => qb.where('activity.albumId', '=', albumId!))
|
.$if(!!albumId, (qb) => qb.where('activity.albumId', '=', albumId!))
|
||||||
.$if(isLiked !== undefined, (qb) => qb.where('activity.isLiked', '=', isLiked!))
|
.$if(isLiked !== undefined, (qb) => qb.where('activity.isLiked', '=', isLiked!))
|
||||||
|
.where('assets.deletedAt', 'is', null)
|
||||||
.orderBy('activity.createdAt', 'asc')
|
.orderBy('activity.createdAt', 'asc')
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user