refactor: move encoded video to asset files table (#26863)

* refactor: move encoded video to asset files table

* chore: update
This commit is contained in:
Brandon Wees
2026-03-12 15:15:21 -05:00
committed by GitHub
parent 990aff441b
commit f3b7cd6198
19 changed files with 158 additions and 60 deletions
+27 -9
View File
@@ -175,7 +175,6 @@ where
select
"asset"."id",
"asset"."ownerId",
"asset"."encodedVideoPath",
(
select
coalesce(json_agg(agg), '[]')
@@ -463,7 +462,6 @@ select
"asset"."libraryId",
"asset"."ownerId",
"asset"."livePhotoVideoId",
"asset"."encodedVideoPath",
"asset"."originalPath",
"asset"."isOffline",
to_json("asset_exif") as "exifInfo",
@@ -521,12 +519,17 @@ select
from
"asset"
where
"asset"."type" = $1
and (
"asset"."encodedVideoPath" is null
or "asset"."encodedVideoPath" = $2
"asset"."type" = 'VIDEO'
and not exists (
select
"asset_file"."id"
from
"asset_file"
where
"asset_file"."assetId" = "asset"."id"
and "asset_file"."type" = 'encoded_video'
)
and "asset"."visibility" != $3
and "asset"."visibility" != 'hidden'
and "asset"."deletedAt" is null
-- AssetJobRepository.getForVideoConversion
@@ -534,12 +537,27 @@ select
"asset"."id",
"asset"."ownerId",
"asset"."originalPath",
"asset"."encodedVideoPath"
(
select
coalesce(json_agg(agg), '[]')
from
(
select
"asset_file"."id",
"asset_file"."path",
"asset_file"."type",
"asset_file"."isEdited"
from
"asset_file"
where
"asset_file"."assetId" = "asset"."id"
) as agg
) as "files"
from
"asset"
where
"asset"."id" = $1
and "asset"."type" = $2
and "asset"."type" = 'VIDEO'
-- AssetJobRepository.streamForMetadataExtraction
select
+12 -4
View File
@@ -629,13 +629,21 @@ order by
-- AssetRepository.getForVideo
select
"asset"."encodedVideoPath",
"asset"."originalPath"
"asset"."originalPath",
(
select
"asset_file"."path"
from
"asset_file"
where
"asset_file"."assetId" = "asset"."id"
and "asset_file"."type" = $1
) as "encodedVideoPath"
from
"asset"
where
"asset"."id" = $1
and "asset"."type" = $2
"asset"."id" = $2
and "asset"."type" = $3
-- AssetRepository.getForOcr
select