mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Server: add video abuse support
This commit is contained in:
parent
a6fd2b30bf
commit
55fa55a9be
32 changed files with 921 additions and 175 deletions
|
@ -5,6 +5,7 @@ const waterfall = require('async/waterfall')
|
|||
|
||||
const db = require('../../initializers/database')
|
||||
const logger = require('../../helpers/logger')
|
||||
const utils = require('../../helpers/utils')
|
||||
const friends = require('../../lib/friends')
|
||||
const middlewares = require('../../middlewares')
|
||||
const admin = middlewares.admin
|
||||
|
@ -36,7 +37,7 @@ router.get('/quitfriends',
|
|||
)
|
||||
// Post because this is a secured request
|
||||
router.post('/remove',
|
||||
signatureValidator,
|
||||
signatureValidator.signature,
|
||||
checkSignature,
|
||||
removePods
|
||||
)
|
||||
|
@ -86,7 +87,7 @@ function listPods (req, res, next) {
|
|||
db.Pod.list(function (err, podsList) {
|
||||
if (err) return next(err)
|
||||
|
||||
res.json(getFormatedPods(podsList))
|
||||
res.json(utils.getFormatedObjects(podsList, podsList.length))
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -130,15 +131,3 @@ function quitFriends (req, res, next) {
|
|||
res.type('json').status(204).end()
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function getFormatedPods (pods) {
|
||||
const formatedPods = []
|
||||
|
||||
pods.forEach(function (pod) {
|
||||
formatedPods.push(pod.toFormatedJSON())
|
||||
})
|
||||
|
||||
return formatedPods
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue