feat(settings): add FFmpeg threads setting for media processing (#415)

* feat(settings): add FFmpeg threads setting for media processing

* style(settings): add bottom padding to media processing page
This commit is contained in:
Yiling-J
2026-09-18 13:30:33 +08:00
committed by GitHub
parent 3a509537fd
commit a91d8c4521
20 changed files with 355 additions and 17 deletions
+38
View File
@@ -260,6 +260,44 @@ describe('team api', () => {
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'transcode.hardwareAcceleration', 'auto')
})
it('PATCH /teams/:teamId/settings updates transcode.threads', async () => {
mockUpdateSettings.mockResolvedValue({ transcode: { threads: 8 } })
const res = await app.request('/teams/t1/settings', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'transcode.threads', value: 8 }),
})
expect(res.status).toBe(200)
const data = await res.json()
expect(data.transcode.threads).toBe(8)
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'transcode.threads', 8)
})
it('PATCH /teams/:teamId/settings rejects invalid transcode.threads', async () => {
const resNegative = await app.request('/teams/t1/settings', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'transcode.threads', value: -1 }),
})
expect(resNegative.status).toBe(400)
const resTooLarge = await app.request('/teams/t1/settings', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'transcode.threads', value: 33 }),
})
expect(resTooLarge.status).toBe(400)
const resFloat = await app.request('/teams/t1/settings', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'transcode.threads', value: 4.5 }),
})
expect(resFloat.status).toBe(400)
})
it('PATCH /teams/:teamId/settings updates appearance.hideAgent', async () => {
mockUpdateSettings.mockResolvedValue({ appearance: { hideAgent: true } })