mirror of
https://github.com/immich-app/immich.git
synced 2026-02-28 17:49:05 +03:00
refactor: asset service queries (#25535)
This commit is contained in:
@@ -636,3 +636,44 @@ from
|
||||
where
|
||||
"asset"."id" = $1
|
||||
and "asset"."type" = $2
|
||||
|
||||
-- AssetRepository.getForOcr
|
||||
select
|
||||
(
|
||||
select
|
||||
coalesce(json_agg(agg), '[]')
|
||||
from
|
||||
(
|
||||
select
|
||||
"asset_edit"."action",
|
||||
"asset_edit"."parameters"
|
||||
from
|
||||
"asset_edit"
|
||||
where
|
||||
"asset_edit"."assetId" = "asset"."id"
|
||||
) as agg
|
||||
) as "edits",
|
||||
"asset_exif"."exifImageWidth",
|
||||
"asset_exif"."exifImageHeight",
|
||||
"asset_exif"."orientation"
|
||||
from
|
||||
"asset"
|
||||
inner join "asset_exif" on "asset_exif"."assetId" = "asset"."id"
|
||||
where
|
||||
"asset"."id" = $1
|
||||
|
||||
-- AssetRepository.getForEdit
|
||||
select
|
||||
"asset"."type",
|
||||
"asset"."livePhotoVideoId",
|
||||
"asset"."originalPath",
|
||||
"asset"."originalFileName",
|
||||
"asset_exif"."exifImageWidth",
|
||||
"asset_exif"."exifImageHeight",
|
||||
"asset_exif"."orientation",
|
||||
"asset_exif"."projectionType"
|
||||
from
|
||||
"asset"
|
||||
inner join "asset_exif" on "asset_exif"."assetId" = "asset"."id"
|
||||
where
|
||||
"asset"."id" = $1
|
||||
|
||||
Reference in New Issue
Block a user