mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 04:14:30 +00:00
feat(transcode): add PDF proxy support for TXT and CSV files
This commit is contained in:
@@ -236,7 +236,7 @@ describe('UploadService', () => {
|
||||
})
|
||||
const asset = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'file.txt',
|
||||
name: 'file.json',
|
||||
type: AssetType.file,
|
||||
project: { connect: { id: projectId } },
|
||||
parent: { connect: { id: parentId } },
|
||||
@@ -247,7 +247,7 @@ describe('UploadService', () => {
|
||||
create: { key: 'test-key' },
|
||||
},
|
||||
},
|
||||
mediaType: 'text/plain',
|
||||
mediaType: 'application/json',
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -303,7 +303,13 @@ export class UploadService {
|
||||
const isVideo = asset.mediaType?.startsWith('video/')
|
||||
const isImage = asset.mediaType?.startsWith('image/')
|
||||
const isAudio = asset.mediaType?.startsWith('audio/')
|
||||
const isPdf = asset.mediaType === 'application/pdf' || asset.name.toLowerCase().endsWith('.pdf')
|
||||
const isPdf =
|
||||
asset.mediaType === 'application/pdf' ||
|
||||
asset.mediaType === 'text/plain' ||
|
||||
asset.mediaType === 'text/csv' ||
|
||||
asset.name.toLowerCase().endsWith('.pdf') ||
|
||||
asset.name.toLowerCase().endsWith('.txt') ||
|
||||
asset.name.toLowerCase().endsWith('.csv')
|
||||
|
||||
if (autofillAgent && (isVideo || isImage)) {
|
||||
await tx.workflowTask.create({
|
||||
|
||||
Reference in New Issue
Block a user