]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/friends.js
Server: pod removing refractoring
[github/Chocobozzz/PeerTube.git] / server / lib / friends.js
index 556d2e7733e934f45d34a3d3098991ff56631c16..55cecc53ed9efc6c2048057af2d4613afbb50c61 100644 (file)
@@ -97,25 +97,13 @@ function quitFriends (callback) {
           // Don't stop the process
         }
 
-        return callbackAsync()
+        return callbackAsync(null, pods)
       })
     },
 
-    function removePodsFromDB (callbackAsync) {
-      Pod.removeAll(function (err) {
-        return callbackAsync(err)
-      })
-    },
-
-    function listRemoteVideos (callbackAsync) {
-      logger.info('Broke friends, so sad :(')
-
-      Video.listRemotes(callbackAsync)
-    },
-
-    function removeTheRemoteVideos (videosList, callbackAsync) {
-      each(videosList, function (video, callbackEach) {
-        video.remove(callbackEach)
+    function removePodsFromDB (pods, callbackAsync) {
+      each(pods, function (pod, callbackEach) {
+        pod.remove(callbackEach)
       }, callbackAsync)
     }
   ], function (err) {