mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(core): export comments to FCP, Premiere, Media Composer, and Resolve (#400)
* feat(core): export comments to FCP, Premiere, Media Composer, and Resolve Add backend support to export video comments matching Frame.io export capabilities: - DaVinci Resolve (.edl): CMX 3600 EDL with ResolveColorPurple markers and reply threading - Avid Media Composer (.xml): OMFI StreamItems XML with TC1 / V1 track allocation and sequential frame positioning - Adobe Premiere Pro (.xml): FCP7 XML sequence with dual marker placement on sequence and generatoritem - Final Cut Pro 10.4.0+ (.fiojson): Flattened JSON schema with frame, timestamp, and annotation serialization Includes DTO schema validation, AssetService export method, API route (GET /files/:fileId/comments/export), SMPTE drop-frame timecode calculations, unit tests, golden master tests, service integration tests, and API endpoint tests. * test(core): move comments export test fixtures to test directory * fix(core): escape asset name in Premiere XML, align Resolve FCM, and support CJK - Escape XML special characters in <name> tag for Premiere Pro XML sequence - Harmonize Resolve EDL FCM header and emitted timecodes using getEffectiveDropFrame - Use RFC 5987 / RFC 6266 buildContentDisposition for CJK filenames in download headers - Add test coverage for CJK filenames, comments, and author names across all 4 NLE formats * fix(core): implement timezone-aware comment exports and sanitize resolve edl
This commit is contained in:
@@ -17,9 +17,10 @@ import {
|
||||
uploadFileRequestSchema,
|
||||
getDownloadLinksRequestSchema,
|
||||
completeCommentRequestSchema,
|
||||
exportCommentsQuerySchema,
|
||||
AuditAction,
|
||||
} from '@shumai/dtos'
|
||||
import { transcodeService } from '@shumai/core'
|
||||
import { transcodeService, buildContentDisposition } from '@shumai/core'
|
||||
import fs from 'fs'
|
||||
import { Hono } from 'hono'
|
||||
import os from 'os'
|
||||
@@ -227,6 +228,28 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
const comments = await assetService.listComments(fileId, req)
|
||||
return c.json(comments)
|
||||
})
|
||||
.get(
|
||||
'/files/:fileId/comments/export',
|
||||
zValidator('query', exportCommentsQuerySchema),
|
||||
async (c) => {
|
||||
const fileId = c.req.param('fileId')
|
||||
const user = c.get('user')
|
||||
const { format, timeZone } = c.req.valid('query')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Asset,
|
||||
id: fileId,
|
||||
})
|
||||
|
||||
const result = await assetService.exportComments(fileId, format, { timeZone })
|
||||
|
||||
c.header('Content-Type', result.mimeType)
|
||||
c.header('Content-Disposition', buildContentDisposition(result.filename))
|
||||
return c.body(result.content)
|
||||
},
|
||||
)
|
||||
.post(
|
||||
'/comments/:commentId/complete',
|
||||
zValidator('json', completeCommentRequestSchema),
|
||||
|
||||
Reference in New Issue
Block a user