aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-11 15:20:03 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commitf285faa04e84b45e62bd05e7050dc500113b0356 (patch)
treebae907d0714e435e92137347e0b892b806c5302c /server/controllers
parent558d7c2385d8a152a94140eed753f511e90986d7 (diff)
downloadPeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.tar.gz
PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.tar.zst
PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.zip
Server: generate magnet uri on the fly
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/videos.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js
index 2c9e4940e..daf452573 100644
--- a/server/controllers/api/videos.js
+++ b/server/controllers/api/videos.js
@@ -110,7 +110,7 @@ function addVideo (req, res, next) {
110 function renameVideoFile (video, callback) { 110 function renameVideoFile (video, callback) {
111 const videoDir = constants.CONFIG.STORAGE.VIDEOS_DIR 111 const videoDir = constants.CONFIG.STORAGE.VIDEOS_DIR
112 const source = path.join(videoDir, videoFile.filename) 112 const source = path.join(videoDir, videoFile.filename)
113 const destination = path.join(videoDir, video.getFilename()) 113 const destination = path.join(videoDir, video.getVideoFilename())
114 114
115 fs.rename(source, destination, function (err) { 115 fs.rename(source, destination, function (err) {
116 return callback(err, video) 116 return callback(err, video)
@@ -118,7 +118,7 @@ function addVideo (req, res, next) {
118 }, 118 },
119 119
120 function insertIntoDB (video, callback) { 120 function insertIntoDB (video, callback) {
121 video.save(function (err, video, videoFile) { 121 video.save(function (err, video) {
122 // Assert there are only one argument sent to the next function (video) 122 // Assert there are only one argument sent to the next function (video)
123 return callback(err, video) 123 return callback(err, video)
124 }) 124 })