Handle .srt subtitles

This commit is contained in:
Chocobozzz
2018-07-16 14:22:16 +02:00
parent 16f7022b06
commit f4001cf408
20 changed files with 336 additions and 53 deletions

View File

@@ -1,6 +1,5 @@
/* tslint:disable:no-unused-expression */
import * as chai from 'chai'
import 'mocha'
import {
createUser,
@@ -127,6 +126,40 @@ describe('Test video captions API validator', function () {
})
})
it('Should fail with an invalid captionfile extension', async function () {
const attaches = {
'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.txt')
}
const captionPath = path + videoUUID + '/captions/fr'
await makeUploadRequest({
method: 'PUT',
url: server.url,
path: captionPath,
token: server.accessToken,
fields,
attaches,
statusCodeExpected: 400
})
})
// it('Should fail with an invalid captionfile srt', async function () {
// const attaches = {
// 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.srt')
// }
//
// const captionPath = path + videoUUID + '/captions/fr'
// await makeUploadRequest({
// method: 'PUT',
// url: server.url,
// path: captionPath,
// token: server.accessToken,
// fields,
// attaches,
// statusCodeExpected: 500
// })
// })
it('Should success with the correct parameters', async function () {
const captionPath = path + videoUUID + '/captions/fr'
await makeUploadRequest({