fix(server): thumbnail queueing (#26077)

* fix thumbnail queueing

* add bmp

* other isEdited column
This commit is contained in:
Mert
2026-02-10 10:04:03 -05:00
committed by GitHub
parent c3730c8eab
commit 7fa6f617f5
6 changed files with 107 additions and 94 deletions
+69 -41
View File
@@ -78,43 +78,13 @@ limit
-- AssetJobRepository.streamForThumbnailJob
select
"asset"."id",
"asset"."thumbhash",
(
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",
(
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"."isEdited"
from
"asset"
inner join "asset_job_status" on "asset_job_status"."assetId" = "asset"."id"
where
"asset"."deletedAt" is null
and "asset"."visibility" != $1
and "asset"."visibility" != 'hidden'
and (
not exists (
select
@@ -122,7 +92,7 @@ where
"asset_file"
where
"assetId" = "asset"."id"
and "asset_file"."type" = $2
and "type" = 'thumbnail'
)
or not exists (
select
@@ -130,17 +100,75 @@ where
"asset_file"
where
"assetId" = "asset"."id"
and "asset_file"."type" = $3
and "type" = 'preview'
)
or not exists (
select
from
"asset_file"
where
"assetId" = "asset"."id"
and "asset_file"."type" = $4
or (
"asset"."isEdited" = true
and not exists (
select
from
"asset_file"
where
"assetId" = "asset"."id"
and "type" = 'fullsize'
and "asset_file"."isEdited" = true
)
)
or "asset"."thumbhash" is null
or (
not exists (
select
from
"asset_file"
where
"assetId" = "asset"."id"
and "type" = 'fullsize'
)
and f_unaccent (asset."originalFileName") like any (
array[
'%.3fr',
'%.ari',
'%.arw',
'%.cap',
'%.cin',
'%.cr2',
'%.cr3',
'%.crw',
'%.dcr',
'%.dng',
'%.erf',
'%.fff',
'%.iiq',
'%.k25',
'%.kdc',
'%.mrw',
'%.nef',
'%.nrw',
'%.orf',
'%.ori',
'%.pef',
'%.psd',
'%.raf',
'%.raw',
'%.rw2',
'%.rwl',
'%.sr2',
'%.srf',
'%.srw',
'%.x3f',
'%.heic',
'%.heif',
'%.hif',
'%.insp',
'%.jp2',
'%.jpe',
'%.jxl',
'%.svg',
'%.tif',
'%.tiff'
]::text[]
)
)
)
-- AssetJobRepository.getForMigrationJob