]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos.js
Server: use binary data instead of base64 to send thumbnails
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos.js
index 170224634961ccb05efc51bdece5ee11c5510e79..ddf85d77dc2dbc834c0333ddae5e48112871f1d0 100644 (file)
@@ -249,27 +249,15 @@ function removeVideo (req, res, next) {
   const videoId = req.params.id
 
   waterfall([
-    function getVideo (callback) {
-      db.Video.load(videoId, callback)
-    },
-
-    function removeFromDB (video, callback) {
-      video.destroy().asCallback(function (err) {
-        if (err) return callback(err)
-
-        return callback(null, video)
+    function loadVideo (callback) {
+      db.Video.load(videoId, function (err, video) {
+        return callback(err, video)
       })
     },
 
-    function sendInformationToFriends (video, callback) {
-      const params = {
-        name: video.name,
-        remoteId: video.id
-      }
-
-      friends.removeVideoToFriends(params)
-
-      return callback(null)
+    function deleteVideo (video, callback) {
+      // Informations to other pods will be sent by the afterDestroy video hook
+      video.destroy().asCallback(callback)
     }
   ], function andFinally (err) {
     if (err) {