refactor: asset media service queries (#25477)

This commit is contained in:
Daniel Dietzler
2026-01-23 15:07:57 -06:00
committed by GitHub
parent f88f1265b6
commit 984fb12ada
5 changed files with 133 additions and 149 deletions
+37
View File
@@ -585,3 +585,40 @@ where
and "libraryId" = $2::uuid
and "isExternal" = $3
)
-- AssetRepository.getForOriginal
select
"originalFileName",
"asset_file"."path" as "editedPath",
"originalPath"
from
"asset"
left join "asset_file" on "asset"."id" = "asset_file"."assetId"
and "asset_file"."isEdited" = $1
and "asset_file"."type" = $2
where
"asset"."id" = $3
-- AssetRepository.getForThumbnail
select
"asset_file"."path",
"asset"."originalPath",
"asset"."originalFileName"
from
"asset_file"
right join "asset" on "asset"."id" = "asset_file"."assetId"
where
"asset_file"."assetId" = $1
and "asset_file"."type" = $2
order by
"asset_file"."isEdited" desc
-- AssetRepository.getForVideo
select
"asset"."encodedVideoPath",
"asset"."originalPath"
from
"asset"
where
"asset"."id" = $1
and "asset"."type" = $2