mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +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
|
@ -8,7 +8,8 @@ const utils = {
|
|||
badRequest,
|
||||
cleanForExit,
|
||||
generateRandomString,
|
||||
isTestInstance
|
||||
isTestInstance,
|
||||
getFormatedObjects
|
||||
}
|
||||
|
||||
function badRequest (req, res, next) {
|
||||
|
@ -32,6 +33,19 @@ function isTestInstance () {
|
|||
return (process.env.NODE_ENV === 'test')
|
||||
}
|
||||
|
||||
function getFormatedObjects (objects, objectsTotal) {
|
||||
const formatedObjects = []
|
||||
|
||||
objects.forEach(function (object) {
|
||||
formatedObjects.push(object.toFormatedJSON())
|
||||
})
|
||||
|
||||
return {
|
||||
total: objectsTotal,
|
||||
data: formatedObjects
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
module.exports = utils
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue