+ .then(({ author, tagInstances, video, videoFile }) => {
+ const tasks = []
+
+ tasks.push(
+ video.createTorrentAndSetInfoHash(videoFile),
+ video.createThumbnail(videoFile),
+ video.createPreview(videoFile)
+ )
+
+ if (CONFIG.TRANSCODING.ENABLED === true) {
+ // Put uuid because we don't have id auto incremented for now
+ const dataInput = {
+ videoUUID: video.uuid
+ }
+
+ tasks.push(
+ JobScheduler.Instance.createJob(t, 'videoTranscoder', dataInput)
+ )
+ }
+
+ return Promise.all(tasks).then(() => ({ author, tagInstances, video, videoFile }))
+ })
+ .then(({ author, tagInstances, video, videoFile }) => {