From 65fcc3119c334b75dd13bcfdebf186afdc580a8f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 May 2017 22:22:03 +0200 Subject: First typescript iteration --- server/lib/jobs/handlers/video-transcoder.js | 43 ---------------------------- 1 file changed, 43 deletions(-) delete mode 100644 server/lib/jobs/handlers/video-transcoder.js (limited to 'server/lib/jobs/handlers/video-transcoder.js') diff --git a/server/lib/jobs/handlers/video-transcoder.js b/server/lib/jobs/handlers/video-transcoder.js deleted file mode 100644 index d2ad4f9c7..000000000 --- a/server/lib/jobs/handlers/video-transcoder.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' - -const db = require('../../../initializers/database') -const logger = require('../../../helpers/logger') -const friends = require('../../../lib/friends') - -const VideoTranscoderHandler = { - process, - onError, - onSuccess -} - -// --------------------------------------------------------------------------- - -function process (data, callback) { - db.Video.loadAndPopulateAuthorAndPodAndTags(data.id, function (err, video) { - if (err) return callback(err) - - video.transcodeVideofile(function (err) { - return callback(err, video) - }) - }) -} - -function onError (err, jobId, video, callback) { - logger.error('Error when transcoding video file in job %d.', jobId, { error: err }) - return callback() -} - -function onSuccess (data, jobId, video, callback) { - logger.info('Job %d is a success.', jobId) - - video.toAddRemoteJSON(function (err, remoteVideo) { - if (err) return callback(err) - - // Now we'll add the video's meta data to our friends - friends.addVideoToFriends(remoteVideo, null, callback) - }) -} - -// --------------------------------------------------------------------------- - -module.exports = VideoTranscoderHandler -- cgit v1.2.3