diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-15 22:22:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-20 09:57:40 +0200 |
commit | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch) | |
tree | 4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/lib/jobs/handlers | |
parent | d5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff) | |
download | PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.gz PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.zst PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.zip |
First typescript iteration
Diffstat (limited to 'server/lib/jobs/handlers')
-rw-r--r-- | server/lib/jobs/handlers/index.js | 7 | ||||
-rw-r--r-- | server/lib/jobs/handlers/index.ts | 9 | ||||
-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 | |||
3 | const videoTranscoder = require('./video-transcoder') | ||
4 | |||
5 | module.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 @@ | |||
1 | import * as videoTranscoder from './video-transcoder' | ||
2 | |||
3 | const jobHandlers = { | ||
4 | videoTranscoder | ||
5 | } | ||
6 | |||
7 | export { | ||
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 | |||
3 | const db = require('../../../initializers/database') | 1 | const db = require('../../../initializers/database') |
4 | const logger = require('../../../helpers/logger') | 2 | import { logger } from '../../../helpers' |
5 | const friends = require('../../../lib/friends') | 3 | import { addVideoToFriends } from '../../../lib' |
6 | |||
7 | const VideoTranscoderHandler = { | ||
8 | process, | ||
9 | onError, | ||
10 | onSuccess | ||
11 | } | ||
12 | |||
13 | // --------------------------------------------------------------------------- | ||
14 | 4 | ||
15 | function process (data, callback) { | 5 | function 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 | ||
43 | module.exports = VideoTranscoderHandler | 33 | export { |
34 | process, | ||
35 | onError, | ||
36 | onSuccess | ||
37 | } | ||