mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 19:47:42 +00:00
feat(asset): replace mediaType/mimeType logic with proxyType
This commit is contained in:
@@ -18,9 +18,10 @@ export async function renderPdfPagesWorkflow(task: WorkflowTask): Promise<void>
|
||||
|
||||
const { asset, key } = await fetchAssetWithKey(workerQueue, task.assetId)
|
||||
const { renderPdfPagesActivity } = getActivities()
|
||||
const pdfKey = (asset.media as PrismaJson.MediaInfo | null)?.pdfTranscode?.key || key
|
||||
|
||||
const pages = await executeActivity(workerQueue, renderPdfPagesActivity, {
|
||||
assetKey: key,
|
||||
assetKey: pdfKey,
|
||||
assetId: asset.id,
|
||||
start: payload.pdfPages.start,
|
||||
end: payload.pdfPages.end,
|
||||
|
||||
@@ -43,6 +43,7 @@ export async function transcodeImageWorkflow(task: WorkflowTask): Promise<void>
|
||||
const mediaInfo = await executeActivity(workerQueue, getMediaInfoActivity, {
|
||||
filePath,
|
||||
assetId: asset.id,
|
||||
proxyType: 'image',
|
||||
mediaType: asset.mediaType || '',
|
||||
})
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ export async function transcodePdfWorkflow(task: WorkflowTask): Promise<void> {
|
||||
const mediaInfo = await executeActivity(workerQueue, getMediaInfoActivity, {
|
||||
filePath: currentFilePath,
|
||||
assetId: asset.id,
|
||||
proxyType: 'pdf',
|
||||
mediaType: asset.mediaType || '',
|
||||
})
|
||||
|
||||
|
||||
@@ -43,9 +43,11 @@ export async function transcodeVideoWorkflow(task: WorkflowTask): Promise<void>
|
||||
tmpDir = download.tmpDir
|
||||
|
||||
const spec = task.payload?.transcode || {}
|
||||
const proxyType = asset.mediaType?.startsWith('audio/') ? 'audio' : 'video'
|
||||
const mediaInfo = await executeActivity(workerQueue, getMediaInfoActivity, {
|
||||
filePath,
|
||||
assetId: asset.id,
|
||||
proxyType,
|
||||
mediaType: asset.mediaType || '',
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user