1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Server: generate magnet uri on the fly

This commit is contained in:
Chocobozzz 2016-11-11 15:20:03 +01:00
parent 558d7c2385
commit f285faa04e
4 changed files with 92 additions and 40 deletions

View file

@ -110,7 +110,7 @@ function addVideo (req, res, next) {
function renameVideoFile (video, callback) {
const videoDir = constants.CONFIG.STORAGE.VIDEOS_DIR
const source = path.join(videoDir, videoFile.filename)
const destination = path.join(videoDir, video.getFilename())
const destination = path.join(videoDir, video.getVideoFilename())
fs.rename(source, destination, function (err) {
return callback(err, video)
@ -118,7 +118,7 @@ function addVideo (req, res, next) {
},
function insertIntoDB (video, callback) {
video.save(function (err, video, videoFile) {
video.save(function (err, video) {
// Assert there are only one argument sent to the next function (video)
return callback(err, video)
})