fix(transcode): co-locate screenshots and derived artifacts in asset storage directory (#399)

* fix(transcode): co-locate screenshots and derived artifacts in asset storage directory

* refactor(transcode): centralize derived artifact directory resolution and strengthen upload assertions
This commit is contained in:
Yiling-J
2026-09-09 11:03:48 +08:00
committed by GitHub
parent 941000d277
commit b37b2172e7
9 changed files with 151 additions and 25 deletions
@@ -2,7 +2,7 @@ import { prisma, WorkflowTaskType, WorkflowTaskStatus } from '@shumai/db'
import { s3Service } from '@shumai/core/src/s3/s3'
import { transcodeService } from '@shumai/core/src/transcode/transcode'
import { metadataService } from '@shumai/core/src/metadata/metadata'
import { stemFromKey } from '@shumai/core/src/utils/filename'
import { getDerivedArtifactDirectory, stemFromKey } from '@shumai/core/src/utils/filename'
import { gotenbergService } from '@shumai/core/src/gotenberg/gotenberg'
import { parseCsvContent } from '@shumai/core/src/transcode/transcode'
import {
@@ -535,7 +535,8 @@ export async function generatePdfProxyActivity(
}
const bucket = process.env.S3_BUCKET || 'shumai'
const pdfProxyKey = `files/${params.assetId}/proxy.pdf`
const assetDir = getDerivedArtifactDirectory(params.assetKey, params.assetId)
const pdfProxyKey = `${assetDir}/proxy.pdf`
const tmpDir = path.dirname(params.filePath)
const pdfFilePath = path.join(tmpDir, 'proxy.pdf')