mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 13:34:33 +00:00
feat(api): remove mediaType and mimeType from DTO responses and DB MediaInfo interface
This commit is contained in:
@@ -79,7 +79,7 @@ describe('file api', () => {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'file',
|
type: 'file',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: 'image/jpeg',
|
proxyType: 'image',
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
@@ -107,7 +107,7 @@ describe('file api', () => {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'file',
|
type: 'file',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: 'image/jpeg',
|
proxyType: 'image',
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
@@ -500,7 +500,7 @@ describe('file api', () => {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'file',
|
type: 'file',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: 'image/jpeg',
|
proxyType: 'image',
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ describe('folder api', () => {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: null,
|
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
@@ -81,7 +80,6 @@ describe('folder api', () => {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: null,
|
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
@@ -113,7 +111,6 @@ describe('folder api', () => {
|
|||||||
fileCount: 0,
|
fileCount: 0,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: null,
|
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
@@ -147,7 +144,6 @@ describe('folder api', () => {
|
|||||||
fileCount: 0,
|
fileCount: 0,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: null,
|
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
},
|
},
|
||||||
@@ -223,7 +219,6 @@ describe('folder api', () => {
|
|||||||
fileCount: 0,
|
fileCount: 0,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: null,
|
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
},
|
},
|
||||||
@@ -261,7 +256,6 @@ describe('folder api', () => {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
mediaType: null,
|
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1475,6 +1475,7 @@ describe('AssetService', () => {
|
|||||||
mediaType: 'video/mp4',
|
mediaType: 'video/mp4',
|
||||||
status: 'processed',
|
status: 'processed',
|
||||||
media: {
|
media: {
|
||||||
|
proxyType: 'video',
|
||||||
poster: { key: 'poster-key' },
|
poster: { key: 'poster-key' },
|
||||||
metadata: { duration: 262 },
|
metadata: { duration: 262 },
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
@@ -1485,7 +1486,7 @@ describe('AssetService', () => {
|
|||||||
const info = await assetService.getAsset({ assetId: video.id })
|
const info = await assetService.getAsset({ assetId: video.id })
|
||||||
|
|
||||||
expect(info.preview).toBeDefined()
|
expect(info.preview).toBeDefined()
|
||||||
expect(info.preview?.mediaType).toBe('video/mp4')
|
expect(info.preview?.proxyType).toBe('video')
|
||||||
expect(info.preview?.duration).toBe(262)
|
expect(info.preview?.duration).toBe(262)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1502,6 +1503,7 @@ describe('AssetService', () => {
|
|||||||
mediaType: 'image/png',
|
mediaType: 'image/png',
|
||||||
status: 'processed',
|
status: 'processed',
|
||||||
media: {
|
media: {
|
||||||
|
proxyType: 'image',
|
||||||
thumbnail: { key: 'thumb-key' },
|
thumbnail: { key: 'thumb-key' },
|
||||||
metadata: { originalWidth: 100, originalHeight: 80 },
|
metadata: { originalWidth: 100, originalHeight: 80 },
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
@@ -1530,6 +1532,7 @@ describe('AssetService', () => {
|
|||||||
mediaType: 'image/png',
|
mediaType: 'image/png',
|
||||||
status: 'processed',
|
status: 'processed',
|
||||||
media: {
|
media: {
|
||||||
|
proxyType: 'image',
|
||||||
thumbnail: { key: 'thumb-key' },
|
thumbnail: { key: 'thumb-key' },
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
} as any,
|
} as any,
|
||||||
@@ -1554,7 +1557,7 @@ describe('AssetService', () => {
|
|||||||
expect(info.type).toBe(AssetType.symlink)
|
expect(info.type).toBe(AssetType.symlink)
|
||||||
// Resolved from target
|
// Resolved from target
|
||||||
expect(info.sizeByte).toBe(5000)
|
expect(info.sizeByte).toBe(5000)
|
||||||
expect(info.mediaType).toBe('image/png')
|
expect(info.proxyType).toBe('image')
|
||||||
expect(info.media).toBeDefined()
|
expect(info.media).toBeDefined()
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
expect((info.media as any).thumbnail?.key).toBe('thumb-key')
|
expect((info.media as any).thumbnail?.key).toBe('thumb-key')
|
||||||
|
|||||||
@@ -1735,7 +1735,6 @@ export class AssetService {
|
|||||||
type: a.type,
|
type: a.type,
|
||||||
targetType: a.type === AssetType.symlink ? a.target?.type : null,
|
targetType: a.type === AssetType.symlink ? a.target?.type : null,
|
||||||
status: latestVersion.status,
|
status: latestVersion.status,
|
||||||
mediaType: latestVersion.mediaType,
|
|
||||||
proxyType,
|
proxyType,
|
||||||
latestChildren,
|
latestChildren,
|
||||||
preview,
|
preview,
|
||||||
@@ -2027,7 +2026,6 @@ export class AssetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mediaType: asset.mediaType,
|
|
||||||
proxyType,
|
proxyType,
|
||||||
thumbnailUrl,
|
thumbnailUrl,
|
||||||
originalHeight: asset.media.metadata?.originalHeight,
|
originalHeight: asset.media.metadata?.originalHeight,
|
||||||
@@ -2067,7 +2065,6 @@ export class AssetService {
|
|||||||
id: a.id,
|
id: a.id,
|
||||||
assetId: a.asset.id,
|
assetId: a.asset.id,
|
||||||
url,
|
url,
|
||||||
mediaType: a.asset.mediaType,
|
|
||||||
proxyType: attachmentProxyType,
|
proxyType: attachmentProxyType,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,7 +401,6 @@ export class NotificationService {
|
|||||||
info.asset = {
|
info.asset = {
|
||||||
id: a.id,
|
id: a.id,
|
||||||
name: a.name,
|
name: a.name,
|
||||||
mediaType: a.mediaType || undefined,
|
|
||||||
proxyType: (a.media as PrismaJson.MediaInfo | null)?.proxyType || undefined,
|
proxyType: (a.media as PrismaJson.MediaInfo | null)?.proxyType || undefined,
|
||||||
preview: previewUrl || undefined,
|
preview: previewUrl || undefined,
|
||||||
thumbnailUrl: thumbnailUrl || undefined,
|
thumbnailUrl: thumbnailUrl || undefined,
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ declare global {
|
|||||||
thumbnail?: ImageTranscode
|
thumbnail?: ImageTranscode
|
||||||
finishedAt: string
|
finishedAt: string
|
||||||
metadata: Metadata | null
|
metadata: Metadata | null
|
||||||
mimeType: string
|
|
||||||
original: OriginalInfo | null
|
original: OriginalInfo | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ export const assetInfoPaginatedListSchema = z.object({
|
|||||||
export type AssetInfoPaginatedList = z.infer<typeof assetInfoPaginatedListSchema>
|
export type AssetInfoPaginatedList = z.infer<typeof assetInfoPaginatedListSchema>
|
||||||
|
|
||||||
export const previewInfoSchema = z.object({
|
export const previewInfoSchema = z.object({
|
||||||
mediaType: z.string().nullable(),
|
|
||||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||||
thumbnailUrl: z.string().optional(),
|
thumbnailUrl: z.string().optional(),
|
||||||
originalHeight: z.number().optional(),
|
originalHeight: z.number().optional(),
|
||||||
@@ -63,7 +62,6 @@ export const assetInfoSchema = z.object({
|
|||||||
type: z.string(),
|
type: z.string(),
|
||||||
targetType: z.string().optional().nullable(),
|
targetType: z.string().optional().nullable(),
|
||||||
status: z.string(),
|
status: z.string(),
|
||||||
mediaType: z.string().nullable(),
|
|
||||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||||
latestChildren: z.array(childPreviewSchema).optional(),
|
latestChildren: z.array(childPreviewSchema).optional(),
|
||||||
preview: previewInfoSchema.nullable().optional(),
|
preview: previewInfoSchema.nullable().optional(),
|
||||||
@@ -108,7 +106,6 @@ export const assetInfoSchema = z.object({
|
|||||||
.optional(),
|
.optional(),
|
||||||
videoPreview: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
videoPreview: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
||||||
pdfTranscode: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
pdfTranscode: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
||||||
mimeType: z.string().optional(),
|
|
||||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||||
metadata: mediaMetadataSchema.optional(),
|
metadata: mediaMetadataSchema.optional(),
|
||||||
})
|
})
|
||||||
@@ -191,7 +188,6 @@ export const attachmentInfoSchema = z.object({
|
|||||||
id: z.string(),
|
id: z.string(),
|
||||||
assetId: z.string(),
|
assetId: z.string(),
|
||||||
url: z.string(),
|
url: z.string(),
|
||||||
mediaType: z.string().nullable(),
|
|
||||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||||
})
|
})
|
||||||
export type AttachmentInfo = z.infer<typeof attachmentInfoSchema>
|
export type AttachmentInfo = z.infer<typeof attachmentInfoSchema>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export type EntityInfo = z.infer<typeof entityInfoSchema>
|
|||||||
|
|
||||||
export const assetPreviewSchema = z.object({
|
export const assetPreviewSchema = z.object({
|
||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
mediaType: z.string().optional(),
|
|
||||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||||
name: z.string().optional(),
|
name: z.string().optional(),
|
||||||
preview: z.string().optional(),
|
preview: z.string().optional(),
|
||||||
|
|||||||
@@ -128,14 +128,14 @@ describe.each(['local', 'temporal'] as const)(
|
|||||||
|
|
||||||
// Verify media info contains videoTranscodes, poster, sprite, and duration details
|
// Verify media info contains videoTranscodes, poster, sprite, and duration details
|
||||||
const mediaInfo = updatedAsset?.media as unknown as {
|
const mediaInfo = updatedAsset?.media as unknown as {
|
||||||
mimeType: string
|
proxyType: string
|
||||||
duration: number
|
duration: number
|
||||||
videoTranscodes: { key: string }[]
|
videoTranscodes: { key: string }[]
|
||||||
poster: unknown
|
poster: unknown
|
||||||
sprite: unknown
|
sprite: unknown
|
||||||
}
|
}
|
||||||
expect(mediaInfo).toBeDefined()
|
expect(mediaInfo).toBeDefined()
|
||||||
expect(mediaInfo.mimeType).toBe('video/mp4')
|
expect(mediaInfo.proxyType).toBe('video')
|
||||||
expect(mediaInfo.duration).toBeCloseTo(1.0, 1)
|
expect(mediaInfo.duration).toBeCloseTo(1.0, 1)
|
||||||
expect(mediaInfo.videoTranscodes).toBeDefined()
|
expect(mediaInfo.videoTranscodes).toBeDefined()
|
||||||
expect(mediaInfo.videoTranscodes.length).toBeGreaterThan(0)
|
expect(mediaInfo.videoTranscodes.length).toBeGreaterThan(0)
|
||||||
@@ -213,12 +213,12 @@ describe.each(['local', 'temporal'] as const)(
|
|||||||
expect(updatedAsset?.status).toBe(AssetStatus.processed)
|
expect(updatedAsset?.status).toBe(AssetStatus.processed)
|
||||||
|
|
||||||
const mediaInfo = updatedAsset?.media as unknown as {
|
const mediaInfo = updatedAsset?.media as unknown as {
|
||||||
mimeType: string
|
proxyType: string
|
||||||
imageTranscodes: unknown[]
|
imageTranscodes: unknown[]
|
||||||
thumbnail: unknown
|
thumbnail: unknown
|
||||||
}
|
}
|
||||||
expect(mediaInfo).toBeDefined()
|
expect(mediaInfo).toBeDefined()
|
||||||
expect(mediaInfo.mimeType).toBe('image/png')
|
expect(mediaInfo.proxyType).toBe('image')
|
||||||
expect(mediaInfo.imageTranscodes).toBeDefined()
|
expect(mediaInfo.imageTranscodes).toBeDefined()
|
||||||
expect(mediaInfo.imageTranscodes.length).toBeGreaterThan(0)
|
expect(mediaInfo.imageTranscodes.length).toBeGreaterThan(0)
|
||||||
expect(mediaInfo.thumbnail).toBeDefined()
|
expect(mediaInfo.thumbnail).toBeDefined()
|
||||||
@@ -292,11 +292,11 @@ describe.each(['local', 'temporal'] as const)(
|
|||||||
expect(updatedAsset?.status).toBe(AssetStatus.processed)
|
expect(updatedAsset?.status).toBe(AssetStatus.processed)
|
||||||
|
|
||||||
const mediaInfo = updatedAsset?.media as unknown as {
|
const mediaInfo = updatedAsset?.media as unknown as {
|
||||||
mimeType: string
|
proxyType: string
|
||||||
videoTranscodes: { key: string }[]
|
videoTranscodes: { key: string }[]
|
||||||
}
|
}
|
||||||
expect(mediaInfo).toBeDefined()
|
expect(mediaInfo).toBeDefined()
|
||||||
expect(mediaInfo.mimeType).toBe('audio/wav')
|
expect(mediaInfo.proxyType).toBe('audio')
|
||||||
expect(mediaInfo.videoTranscodes).toBeDefined()
|
expect(mediaInfo.videoTranscodes).toBeDefined()
|
||||||
expect(mediaInfo.videoTranscodes.length).toBeGreaterThan(0)
|
expect(mediaInfo.videoTranscodes.length).toBeGreaterThan(0)
|
||||||
// Audio proxy key should end with -audio-proxy.mp4
|
// Audio proxy key should end with -audio-proxy.mp4
|
||||||
@@ -529,7 +529,7 @@ describe.each(['local', 'temporal'] as const)(
|
|||||||
|
|
||||||
// Verify media info contains pdf details, poster, sprite, and pageCount
|
// Verify media info contains pdf details, poster, sprite, and pageCount
|
||||||
const mediaInfo = updatedAsset?.media as unknown as {
|
const mediaInfo = updatedAsset?.media as unknown as {
|
||||||
mimeType: string
|
proxyType: string
|
||||||
poster: { key: string }
|
poster: { key: string }
|
||||||
sprite: { key: string }
|
sprite: { key: string }
|
||||||
frames?: number
|
frames?: number
|
||||||
@@ -537,7 +537,7 @@ describe.each(['local', 'temporal'] as const)(
|
|||||||
metadata?: { totalFrames?: number; pageCount?: number }
|
metadata?: { totalFrames?: number; pageCount?: number }
|
||||||
}
|
}
|
||||||
expect(mediaInfo).toBeDefined()
|
expect(mediaInfo).toBeDefined()
|
||||||
expect(mediaInfo.mimeType).toBe('application/pdf')
|
expect(mediaInfo.proxyType).toBe('pdf')
|
||||||
expect(mediaInfo.poster).toBeDefined()
|
expect(mediaInfo.poster).toBeDefined()
|
||||||
expect(mediaInfo.poster.key).toContain('poster.webp')
|
expect(mediaInfo.poster.key).toContain('poster.webp')
|
||||||
expect(mediaInfo.sprite).toBeDefined()
|
expect(mediaInfo.sprite).toBeDefined()
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ export async function getMediaInfoActivity(params: {
|
|||||||
videoPreview: { width: 0, height: 0 },
|
videoPreview: { width: 0, height: 0 },
|
||||||
finishedAt: new Date().toISOString(),
|
finishedAt: new Date().toISOString(),
|
||||||
metadata: null,
|
metadata: null,
|
||||||
mimeType: params.mediaType || '',
|
|
||||||
original: {
|
original: {
|
||||||
key: '', // Will be filled by caller or updated later
|
key: '', // Will be filled by caller or updated later
|
||||||
downloadUrl: '',
|
downloadUrl: '',
|
||||||
@@ -428,7 +427,7 @@ export async function generateSpriteActivity(params: GenerateSpriteActivityParam
|
|||||||
const posterFile = path.join(tmpDir, 'poster.webp')
|
const posterFile = path.join(tmpDir, 'poster.webp')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (params.mediaInfo.proxyType === 'pdf' || params.mediaInfo.mimeType === 'application/pdf') {
|
if (params.mediaInfo.proxyType === 'pdf') {
|
||||||
const pdfRes = await transcodeService.generatePdfSprite(
|
const pdfRes = await transcodeService.generatePdfSprite(
|
||||||
params.filePath,
|
params.filePath,
|
||||||
spriteFile,
|
spriteFile,
|
||||||
|
|||||||
@@ -54,12 +54,10 @@ export async function transcodeImageWorkflow(task: WorkflowTask): Promise<void>
|
|||||||
codec: '',
|
codec: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
const mimeType = mediaInfo.mimeType
|
|
||||||
const metadata = mediaInfo.metadata
|
const metadata = mediaInfo.metadata
|
||||||
|
|
||||||
const isImage = mimeType.startsWith('image/')
|
const isImage = mediaInfo.proxyType === 'image'
|
||||||
const isPsd = isMimePsd(mimeType)
|
if (isImage && metadata) {
|
||||||
if ((isImage || isPsd) && metadata) {
|
|
||||||
const imageSpec: PrismaJson.ImageTranscode = {
|
const imageSpec: PrismaJson.ImageTranscode = {
|
||||||
width: metadata.originalWidth,
|
width: metadata.originalWidth,
|
||||||
height: metadata.originalHeight,
|
height: metadata.originalHeight,
|
||||||
|
|||||||
@@ -58,10 +58,9 @@ export async function transcodeVideoWorkflow(task: WorkflowTask): Promise<void>
|
|||||||
codec: '',
|
codec: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
const mimeType = mediaInfo.mimeType
|
|
||||||
const metadata = mediaInfo.metadata
|
const metadata = mediaInfo.metadata
|
||||||
|
|
||||||
if (mimeType.startsWith('video/') && metadata) {
|
if (mediaInfo.proxyType === 'video' && metadata) {
|
||||||
const videoResolutions = getTargetVideoResolutions(
|
const videoResolutions = getTargetVideoResolutions(
|
||||||
spec.videoStrategy || 'best_match',
|
spec.videoStrategy || 'best_match',
|
||||||
metadata.originalWidth,
|
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) {
|
if (isAudio && metadata) {
|
||||||
const audioTranscode = await executeActivity(workerQueue, transcodeAudioActivity, {
|
const audioTranscode = await executeActivity(workerQueue, transcodeAudioActivity, {
|
||||||
assetKey: key,
|
assetKey: key,
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ interface BreadcrumbNavProps {
|
|||||||
name?: string
|
name?: string
|
||||||
type: 'file' | 'folder'
|
type: 'file' | 'folder'
|
||||||
version?: number
|
version?: number
|
||||||
mediaType?: string | null
|
|
||||||
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
|
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
|
||||||
}
|
}
|
||||||
isRootFolder: boolean
|
isRootFolder: boolean
|
||||||
|
|||||||
@@ -513,10 +513,20 @@ export function FileBrowser({
|
|||||||
fileCount: 0,
|
fileCount: 0,
|
||||||
type: 'file',
|
type: 'file',
|
||||||
status: hasUrl ? 'uploading' : 'error',
|
status: hasUrl ? 'uploading' : 'error',
|
||||||
mediaType:
|
proxyType:
|
||||||
f.file.name.toLowerCase().endsWith('.wma') && f.file.type?.startsWith('video/')
|
f.file.name.toLowerCase().endsWith('.wma') && f.file.type?.startsWith('video/')
|
||||||
? f.file.type.replace(/^video\//, 'audio/')
|
? 'audio'
|
||||||
: f.file.type || null,
|
: 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(),
|
createdAt: new Date().toISOString(),
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -487,7 +487,6 @@ export function FolderTree({
|
|||||||
sizeByte: 0,
|
sizeByte: 0,
|
||||||
fileCount: 0,
|
fileCount: 0,
|
||||||
status: 'processed',
|
status: 'processed',
|
||||||
mediaType: null,
|
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ export function PublicShareManager({
|
|||||||
? (stackFileData.versionStack.versions.find((v) => v.id === activeFileId)?.version ??
|
? (stackFileData.versionStack.versions.find((v) => v.id === activeFileId)?.version ??
|
||||||
stackFileData.versionStack.versions.length)
|
stackFileData.versionStack.versions.length)
|
||||||
: undefined,
|
: undefined,
|
||||||
mediaType: viewingFileData?.mediaType || null,
|
proxyType: viewingFileData?.proxyType || null,
|
||||||
},
|
},
|
||||||
isRootFolder: currentFolderId === shareInfo.rootFolderId && !viewingFileId,
|
isRootFolder: currentFolderId === shareInfo.rootFolderId && !viewingFileId,
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ export const sampleVideoAsset: AssetInfo = {
|
|||||||
fileCount: 1,
|
fileCount: 1,
|
||||||
type: 'file',
|
type: 'file',
|
||||||
status: 'ready',
|
status: 'ready',
|
||||||
mediaType: 'video',
|
|
||||||
proxyType: 'video',
|
proxyType: 'video',
|
||||||
createdAt: '2024-01-01T00:00:00.000Z',
|
createdAt: '2024-01-01T00:00:00.000Z',
|
||||||
updatedAt: '2024-01-01T00:00:00.000Z',
|
updatedAt: '2024-01-01T00:00:00.000Z',
|
||||||
@@ -151,7 +150,6 @@ export const sampleAudioAsset: AssetInfo = {
|
|||||||
...sampleVideoAsset,
|
...sampleVideoAsset,
|
||||||
id: 'e2e-sample-audio-asset',
|
id: 'e2e-sample-audio-asset',
|
||||||
name: 'sample-audio.mp4',
|
name: 'sample-audio.mp4',
|
||||||
mediaType: 'audio/mp4',
|
|
||||||
proxyType: 'audio',
|
proxyType: 'audio',
|
||||||
media: {
|
media: {
|
||||||
proxyType: 'audio',
|
proxyType: 'audio',
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ function FileViewPage() {
|
|||||||
? (versionsDataList.find((v: { id: string }) => v.id === activeFileId)?.version ??
|
? (versionsDataList.find((v: { id: string }) => v.id === activeFileId)?.version ??
|
||||||
versionsDataList.length)
|
versionsDataList.length)
|
||||||
: undefined,
|
: undefined,
|
||||||
mediaType: fileData.mediaType,
|
proxyType: fileData.proxyType,
|
||||||
},
|
},
|
||||||
isRootFolder: false,
|
isRootFolder: false,
|
||||||
fileId,
|
fileId,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export interface TopNavProjectState {
|
|||||||
name?: string
|
name?: string
|
||||||
type: 'file' | 'folder'
|
type: 'file' | 'folder'
|
||||||
version?: number
|
version?: number
|
||||||
mediaType?: string | null
|
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
|
||||||
}
|
}
|
||||||
isRootFolder: boolean
|
isRootFolder: boolean
|
||||||
fileId?: string
|
fileId?: string
|
||||||
|
|||||||
Reference in New Issue
Block a user