]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos/blacklist.ts
Add ability for uploaders to schedule video update
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos / blacklist.ts
index d08c6e13f0e6c4a614e0aae5fa306715f1141f76..8112b59b804464e6eb0fc3653e81d8d6f5876fcc 100644 (file)
@@ -1,17 +1,11 @@
 import * as express from 'express'
-import { logger, getFormattedObjects } from '../../../helpers'
+import { BlacklistedVideo, UserRight } from '../../../../shared'
+import { logger } from '../../../helpers/logger'
+import { getFormattedObjects } from '../../../helpers/utils'
 import {
-  authenticate,
-  ensureUserHasRight,
-  videosBlacklistAddValidator,
-  videosBlacklistRemoveValidator,
-  paginationValidator,
-  blacklistSortValidator,
-  setBlacklistSort,
-  setPagination,
-  asyncMiddleware
+  asyncMiddleware, authenticate, blacklistSortValidator, ensureUserHasRight, paginationValidator, setBlacklistSort, setDefaultPagination,
+  videosBlacklistAddValidator, videosBlacklistRemoveValidator
 } from '../../../middlewares'
-import { BlacklistedVideo, UserRight } from '../../../../shared'
 import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
 
 const blacklistRouter = express.Router()
@@ -29,7 +23,7 @@ blacklistRouter.get('/blacklist',
   paginationValidator,
   blacklistSortValidator,
   setBlacklistSort,
-  setPagination,
+  setDefaultPagination,
   asyncMiddleware(listBlacklist)
 )
 
@@ -75,7 +69,7 @@ async function removeVideoFromBlacklistController (req: express.Request, res: ex
 
     return res.sendStatus(204)
   } catch (err) {
-    logger.error('Some error while removing video %s from blacklist.', res.locals.video.uuid, err)
+    logger.error('Some error while removing video %s from blacklist.', res.locals.video.uuid, { err })
     throw err
   }
 }