]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video.js
Server: do not make friends with myself
[github/Chocobozzz/PeerTube.git] / server / models / video.js
index 1feefe24fa7667bd49f9df76f048ba9db65cc8d2..05c4f51cb2d7211918e71f5c261b605c2d90b51c 100644 (file)
@@ -94,7 +94,7 @@ VideoSchema.pre('save', function (next) {
   const tasks = []
 
   if (video.isOwned()) {
-    const videoPath = pathUtils.join(constants.CONFIG.STORAGE.UPLOAD_DIR, video.filename)
+    const videoPath = pathUtils.join(constants.CONFIG.STORAGE.VIDEOS_DIR, video.filename)
     this.podUrl = constants.CONFIG.WEBSERVER.URL
 
     tasks.push(
@@ -258,7 +258,7 @@ function removeThumbnail (video, callback) {
 }
 
 function removeFile (video, callback) {
-  fs.unlink(constants.CONFIG.STORAGE.UPLOAD_DIR + video.filename, callback)
+  fs.unlink(constants.CONFIG.STORAGE.VIDEOS_DIR + video.filename, callback)
 }
 
 // Maybe the torrent is not seeded, but we catch the error to don't stop the removing process