diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-transcoding-job.ts | 13 | ||||
-rwxr-xr-x | scripts/travis.sh | 8 |
2 files changed, 8 insertions, 13 deletions
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts index 4a677eacb..2b7cb5177 100755 --- a/scripts/create-transcoding-job.ts +++ b/scripts/create-transcoding-job.ts | |||
@@ -2,6 +2,7 @@ import * as program from 'commander' | |||
2 | import { VideoModel } from '../server/models/video/video' | 2 | import { VideoModel } from '../server/models/video/video' |
3 | import { initDatabaseModels } from '../server/initializers' | 3 | import { initDatabaseModels } from '../server/initializers' |
4 | import { JobQueue } from '../server/lib/job-queue' | 4 | import { JobQueue } from '../server/lib/job-queue' |
5 | import { VideoTranscodingPayload } from '../server/lib/job-queue/handlers/video-transcoding' | ||
5 | 6 | ||
6 | program | 7 | program |
7 | .option('-v, --video [videoUUID]', 'Video UUID') | 8 | .option('-v, --video [videoUUID]', 'Video UUID') |
@@ -31,15 +32,9 @@ async function run () { | |||
31 | const video = await VideoModel.loadByUUIDWithFile(program['video']) | 32 | const video = await VideoModel.loadByUUIDWithFile(program['video']) |
32 | if (!video) throw new Error('Video not found.') | 33 | if (!video) throw new Error('Video not found.') |
33 | 34 | ||
34 | const dataInput = { | 35 | const dataInput: VideoTranscodingPayload = program.resolution !== undefined |
35 | videoUUID: video.uuid, | 36 | ? { type: 'new-resolution' as 'new-resolution', videoUUID: video.uuid, isNewVideo: false, resolution: program.resolution } |
36 | isNewVideo: false, | 37 | : { type: 'optimize' as 'optimize', videoUUID: video.uuid, isNewVideo: false } |
37 | resolution: undefined | ||
38 | } | ||
39 | |||
40 | if (program.resolution !== undefined) { | ||
41 | dataInput.resolution = program.resolution | ||
42 | } | ||
43 | 38 | ||
44 | await JobQueue.Instance.init() | 39 | await JobQueue.Instance.init() |
45 | await JobQueue.Instance.createJob({ type: 'video-transcoding', payload: dataInput }) | 40 | await JobQueue.Instance.createJob({ type: 'video-transcoding', payload: dataInput }) |
diff --git a/scripts/travis.sh b/scripts/travis.sh index 3557816c8..c38bd2cab 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh | |||
@@ -20,16 +20,16 @@ elif [ "$1" = "cli" ]; then | |||
20 | mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/cli/index.ts | 20 | mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/cli/index.ts |
21 | elif [ "$1" = "api-1" ]; then | 21 | elif [ "$1" = "api-1" ]; then |
22 | npm run build:server | 22 | npm run build:server |
23 | mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-1.ts | 23 | sh ./server/tests/api/travis-1.sh 2 |
24 | elif [ "$1" = "api-2" ]; then | 24 | elif [ "$1" = "api-2" ]; then |
25 | npm run build:server | 25 | npm run build:server |
26 | mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-2.ts | 26 | sh ./server/tests/api/travis-2.sh 2 |
27 | elif [ "$1" = "api-3" ]; then | 27 | elif [ "$1" = "api-3" ]; then |
28 | npm run build:server | 28 | npm run build:server |
29 | mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-3.ts | 29 | sh ./server/tests/api/travis-3.sh 2 |
30 | elif [ "$1" = "api-4" ]; then | 30 | elif [ "$1" = "api-4" ]; then |
31 | npm run build:server | 31 | npm run build:server |
32 | mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-4.ts | 32 | sh ./server/tests/api/travis-4.sh 2 |
33 | elif [ "$1" = "lint" ]; then | 33 | elif [ "$1" = "lint" ]; then |
34 | npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts" | 34 | npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts" |
35 | 35 | ||