mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 22:08:51 +00:00
feat(api): remove mediaType and mimeType from DTO responses and DB MediaInfo interface
This commit is contained in:
@@ -73,7 +73,6 @@ export async function getMediaInfoActivity(params: {
|
||||
videoPreview: { width: 0, height: 0 },
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: null,
|
||||
mimeType: params.mediaType || '',
|
||||
original: {
|
||||
key: '', // Will be filled by caller or updated later
|
||||
downloadUrl: '',
|
||||
@@ -428,7 +427,7 @@ export async function generateSpriteActivity(params: GenerateSpriteActivityParam
|
||||
const posterFile = path.join(tmpDir, 'poster.webp')
|
||||
|
||||
try {
|
||||
if (params.mediaInfo.proxyType === 'pdf' || params.mediaInfo.mimeType === 'application/pdf') {
|
||||
if (params.mediaInfo.proxyType === 'pdf') {
|
||||
const pdfRes = await transcodeService.generatePdfSprite(
|
||||
params.filePath,
|
||||
spriteFile,
|
||||
|
||||
@@ -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