},
function sendToFriends (t, video, callback) {
+ // Let transcoding job send the video to friends because the videofile extension might change
+ if (constants.CONFIG.TRANSCODING.ENABLED === true) return callback(null, t)
+
video.toAddRemoteJSON(function (err, remoteVideo) {
if (err) return callback(err)
function addVideoToBlacklist (req, res, next) {
const videoInstance = res.locals.video
- db.BlacklistedVideo.create({
+ const toCreate = {
videoId: videoInstance.id
- })
- .asCallback(function (err) {
+ }
+
+ db.BlacklistedVideo.create(toCreate).asCallback(function (err) {
if (err) {
logger.error('Errors when blacklisting video ', { error: err })
return next(err)