aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/v1/pods.js24
1 files changed, 1 insertions, 23 deletions
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index 8ffade578..2f4621327 100644
--- a/server/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
@@ -1,6 +1,5 @@
1'use strict' 1'use strict'
2 2
3const each = require('async/each')
4const express = require('express') 3const express = require('express')
5const mongoose = require('mongoose') 4const mongoose = require('mongoose')
6const waterfall = require('async/waterfall') 5const waterfall = require('async/waterfall')
@@ -17,7 +16,6 @@ const signatureValidator = middlewares.validators.remote.signature
17 16
18const router = express.Router() 17const router = express.Router()
19const Pod = mongoose.model('Pod') 18const Pod = mongoose.model('Pod')
20const Video = mongoose.model('Video')
21 19
22router.get('/', listPods) 20router.get('/', listPods)
23router.post('/', 21router.post('/',
@@ -117,27 +115,7 @@ function removePods (req, res, next) {
117 }, 115 },
118 116
119 function removePod (pod, callback) { 117 function removePod (pod, callback) {
120 pod.remove(function (err) { 118 pod.remove(callback)
121 // Be sure we only return one argument in the callback
122 return callback(err)
123 })
124 },
125
126 function (callback) {
127 Video.listByUrls([ url ], function (err, videosList) {
128 if (err) {
129 logger.error('Cannot list videos from url.', { error: err })
130 return callback(err)
131 }
132
133 return callback(null, videosList)
134 })
135 },
136
137 function removeTheRemoteVideos (videosList, callback) {
138 each(videosList, function (video, callbackEach) {
139 video.remove(callbackEach)
140 }, callback)
141 } 119 }
142 ], function (err) { 120 ], function (err) {
143 if (err) return next(err) 121 if (err) return next(err)