aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/jobs/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/jobs/handlers')
-rw-r--r--server/lib/jobs/handlers/index.js7
-rw-r--r--server/lib/jobs/handlers/index.ts9
-rw-r--r--server/lib/jobs/handlers/video-transcoder.ts (renamed from server/lib/jobs/handlers/video-transcoder.js)22
3 files changed, 17 insertions, 21 deletions
diff --git a/server/lib/jobs/handlers/index.js b/server/lib/jobs/handlers/index.js
deleted file mode 100644
index 59c1ccce5..000000000
--- a/server/lib/jobs/handlers/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
1'use strict'
2
3const videoTranscoder = require('./video-transcoder')
4
5module.exports = {
6 videoTranscoder
7}
diff --git a/server/lib/jobs/handlers/index.ts b/server/lib/jobs/handlers/index.ts
new file mode 100644
index 000000000..ae5440031
--- /dev/null
+++ b/server/lib/jobs/handlers/index.ts
@@ -0,0 +1,9 @@
1import * as videoTranscoder from './video-transcoder'
2
3const jobHandlers = {
4 videoTranscoder
5}
6
7export {
8 jobHandlers
9}
diff --git a/server/lib/jobs/handlers/video-transcoder.js b/server/lib/jobs/handlers/video-transcoder.ts
index d2ad4f9c7..35db5fb96 100644
--- a/server/lib/jobs/handlers/video-transcoder.js
+++ b/server/lib/jobs/handlers/video-transcoder.ts
@@ -1,16 +1,6 @@
1'use strict'
2
3const db = require('../../../initializers/database') 1const db = require('../../../initializers/database')
4const logger = require('../../../helpers/logger') 2import { logger } from '../../../helpers'
5const friends = require('../../../lib/friends') 3import { addVideoToFriends } from '../../../lib'
6
7const VideoTranscoderHandler = {
8 process,
9 onError,
10 onSuccess
11}
12
13// ---------------------------------------------------------------------------
14 4
15function process (data, callback) { 5function process (data, callback) {
16 db.Video.loadAndPopulateAuthorAndPodAndTags(data.id, function (err, video) { 6 db.Video.loadAndPopulateAuthorAndPodAndTags(data.id, function (err, video) {
@@ -34,10 +24,14 @@ function onSuccess (data, jobId, video, callback) {
34 if (err) return callback(err) 24 if (err) return callback(err)
35 25
36 // Now we'll add the video's meta data to our friends 26 // Now we'll add the video's meta data to our friends
37 friends.addVideoToFriends(remoteVideo, null, callback) 27 addVideoToFriends(remoteVideo, null, callback)
38 }) 28 })
39} 29}
40 30
41// --------------------------------------------------------------------------- 31// ---------------------------------------------------------------------------
42 32
43module.exports = VideoTranscoderHandler 33export {
34 process,
35 onError,
36 onSuccess
37}