aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/jobs/handlers/video-transcoder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/jobs/handlers/video-transcoder.ts')
-rw-r--r--server/lib/jobs/handlers/video-transcoder.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/jobs/handlers/video-transcoder.ts b/server/lib/jobs/handlers/video-transcoder.ts
index 43599356a..efa18ef2d 100644
--- a/server/lib/jobs/handlers/video-transcoder.ts
+++ b/server/lib/jobs/handlers/video-transcoder.ts
@@ -1,8 +1,9 @@
1import { database as db } from '../../../initializers/database' 1import { database as db } from '../../../initializers/database'
2import { logger } from '../../../helpers' 2import { logger } from '../../../helpers'
3import { addVideoToFriends } from '../../../lib' 3import { addVideoToFriends } from '../../../lib'
4import { VideoInstance } from '../../../models'
4 5
5function process (data, callback) { 6function process (data: { id: string }, callback: (err: Error, videoInstance?: VideoInstance) => void) {
6 db.Video.loadAndPopulateAuthorAndPodAndTags(data.id, function (err, video) { 7 db.Video.loadAndPopulateAuthorAndPodAndTags(data.id, function (err, video) {
7 if (err) return callback(err) 8 if (err) return callback(err)
8 9
@@ -12,12 +13,12 @@ function process (data, callback) {
12 }) 13 })
13} 14}
14 15
15function onError (err, jobId, video, callback) { 16function onError (err: Error, jobId: number, video: VideoInstance, callback: () => void) {
16 logger.error('Error when transcoding video file in job %d.', jobId, { error: err }) 17 logger.error('Error when transcoding video file in job %d.', jobId, { error: err })
17 return callback() 18 return callback()
18} 19}
19 20
20function onSuccess (data, jobId, video, callback) { 21function onSuccess (data: any, jobId: number, video: VideoInstance, callback: (err: Error) => void) {
21 logger.info('Job %d is a success.', jobId) 22 logger.info('Job %d is a success.', jobId)
22 23
23 video.toAddRemoteJSON(function (err, remoteVideo) { 24 video.toAddRemoteJSON(function (err, remoteVideo) {