feat(api): remove mediaType and mimeType from DTO responses and DB MediaInfo interface

This commit is contained in:
yiling
2026-07-20 14:37:17 +08:00
parent 5d4020dc2d
commit 3afe0fc3c3
19 changed files with 37 additions and 48 deletions
@@ -50,7 +50,6 @@ interface BreadcrumbNavProps {
name?: string
type: 'file' | 'folder'
version?: number
mediaType?: string | null
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
}
isRootFolder: boolean
@@ -513,10 +513,20 @@ export function FileBrowser({
fileCount: 0,
type: 'file',
status: hasUrl ? 'uploading' : 'error',
mediaType:
proxyType:
f.file.name.toLowerCase().endsWith('.wma') && f.file.type?.startsWith('video/')
? f.file.type.replace(/^video\//, 'audio/')
: f.file.type || null,
? 'audio'
: f.file.type?.startsWith('image/')
? 'image'
: f.file.type?.startsWith('video/')
? 'video'
: f.file.type?.startsWith('audio/')
? 'audio'
: f.file.name.endsWith('.pdf') ||
f.file.name.endsWith('.txt') ||
f.file.name.endsWith('.csv')
? 'pdf'
: null,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
}
@@ -487,7 +487,6 @@ export function FolderTree({
sizeByte: 0,
fileCount: 0,
status: 'processed',
mediaType: null,
createdAt: '',
updatedAt: '',
}}
@@ -412,7 +412,7 @@ export function PublicShareManager({
? (stackFileData.versionStack.versions.find((v) => v.id === activeFileId)?.version ??
stackFileData.versionStack.versions.length)
: undefined,
mediaType: viewingFileData?.mediaType || null,
proxyType: viewingFileData?.proxyType || null,
},
isRootFolder: currentFolderId === shareInfo.rootFolderId && !viewingFileId,
isPublic: true,