mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 17:20:18 +00:00
feat(api): remove mediaType and mimeType from DTO responses and DB MediaInfo interface
This commit is contained in:
@@ -54,12 +54,10 @@ export async function transcodeImageWorkflow(task: WorkflowTask): Promise<void>
|
||||
codec: '',
|
||||
}
|
||||
|
||||
const mimeType = mediaInfo.mimeType
|
||||
const metadata = mediaInfo.metadata
|
||||
|
||||
const isImage = mimeType.startsWith('image/')
|
||||
const isPsd = isMimePsd(mimeType)
|
||||
if ((isImage || isPsd) && metadata) {
|
||||
const isImage = mediaInfo.proxyType === 'image'
|
||||
if (isImage && metadata) {
|
||||
const imageSpec: PrismaJson.ImageTranscode = {
|
||||
width: metadata.originalWidth,
|
||||
height: metadata.originalHeight,
|
||||
|
||||
@@ -58,10 +58,9 @@ export async function transcodeVideoWorkflow(task: WorkflowTask): Promise<void>
|
||||
codec: '',
|
||||
}
|
||||
|
||||
const mimeType = mediaInfo.mimeType
|
||||
const metadata = mediaInfo.metadata
|
||||
|
||||
if (mimeType.startsWith('video/') && metadata) {
|
||||
if (mediaInfo.proxyType === 'video' && metadata) {
|
||||
const videoResolutions = getTargetVideoResolutions(
|
||||
spec.videoStrategy || 'best_match',
|
||||
metadata.originalWidth,
|
||||
@@ -103,7 +102,7 @@ export async function transcodeVideoWorkflow(task: WorkflowTask): Promise<void>
|
||||
})
|
||||
}
|
||||
|
||||
const isAudio = mimeType.startsWith('audio/')
|
||||
const isAudio = mediaInfo.proxyType === 'audio'
|
||||
if (isAudio && metadata) {
|
||||
const audioTranscode = await executeActivity(workerQueue, transcodeAudioActivity, {
|
||||
assetKey: key,
|
||||
|
||||
Reference in New Issue
Block a user