feat(transcode): implement new image and video transcode strategies with UI detail enhancements

This commit is contained in:
yiling
2026-05-30 12:09:27 +08:00
parent ed8a08ec91
commit ec14e12b3f
13 changed files with 149 additions and 194 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ describe('CollectionService', () => {
name: 'Test Team',
settings: {
enablePublicSignup: true,
transcode: { videoStrategy: 'disable', imageStrategy: 'disable' },
transcode: { videoStrategy: 'best_match' },
},
sandbox: { create: {} },
},
+1 -1
View File
@@ -25,7 +25,7 @@ export class TeamService {
name: 'Default Team',
settings: {
enablePublicSignup: true,
transcode: { videoStrategy: 'disable', imageStrategy: 'disable' },
transcode: { videoStrategy: 'best_match' },
},
sandbox: { create: {} },
},
+1 -2
View File
@@ -127,7 +127,7 @@ describe('UploadService', () => {
expect(workflowTask?.payload).toEqual({
projectId: projectId,
transcode: {
videoStrategy: 'single',
videoStrategy: 'best_match',
sprite: true,
poster: true,
},
@@ -164,7 +164,6 @@ describe('UploadService', () => {
expect(workflowTask?.payload).toEqual({
projectId: projectId,
transcode: {
imageStrategy: 'single',
thumbnail: true,
},
})
+1 -3
View File
@@ -299,7 +299,7 @@ export class UploadService {
} else {
const settings = team.settings as PrismaJson.Settings | null
if (isVideo) {
const strategy = settings?.transcode?.videoStrategy || 'single'
const strategy = settings?.transcode?.videoStrategy || 'best_match'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await new VideoTranscoder(tx as any, asset.id, team.id, asset.projectId)
.setStrategy(strategy)
@@ -307,10 +307,8 @@ export class UploadService {
.withPoster()
.submit()
} else if (isImage) {
const strategy = settings?.transcode?.imageStrategy || 'single'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await new ImageTranscoder(tx as any, asset.id, team.id, asset.projectId)
.setStrategy(strategy)
.withThumbnail()
.submit()
}