aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/v1/videos.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/v1/videos.js')
-rw-r--r--server/controllers/api/v1/videos.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/controllers/api/v1/videos.js b/server/controllers/api/v1/videos.js
index c86a96a25..9891bf4c6 100644
--- a/server/controllers/api/v1/videos.js
+++ b/server/controllers/api/v1/videos.js
@@ -11,7 +11,6 @@ const logger = require('../../../helpers/logger')
11const friends = require('../../../lib/friends') 11const friends = require('../../../lib/friends')
12const middleware = require('../../../middlewares') 12const middleware = require('../../../middlewares')
13const oAuth2 = require('../../../middlewares/oauth2') 13const oAuth2 = require('../../../middlewares/oauth2')
14const cacheMiddleware = middleware.cache
15const reqValidator = middleware.reqValidators.videos 14const reqValidator = middleware.reqValidators.videos
16const utils = require('../../../helpers/utils') 15const utils = require('../../../helpers/utils')
17const Videos = require('../../../models/videos') // model 16const Videos = require('../../../models/videos') // model
@@ -42,11 +41,11 @@ const storage = multer.diskStorage({
42const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }]) 41const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }])
43const thumbnailsDir = path.join(__dirname, '..', '..', '..', '..', config.get('storage.thumbnails')) 42const thumbnailsDir = path.join(__dirname, '..', '..', '..', '..', config.get('storage.thumbnails'))
44 43
45router.get('/', cacheMiddleware.cache(false), listVideos) 44router.get('/', listVideos)
46router.post('/', oAuth2.authenticate, reqFiles, reqValidator.videosAdd, cacheMiddleware.cache(false), addVideo) 45router.post('/', oAuth2.authenticate, reqFiles, reqValidator.videosAdd, addVideo)
47router.get('/:id', reqValidator.videosGet, cacheMiddleware.cache(false), getVideos) 46router.get('/:id', reqValidator.videosGet, getVideos)
48router.delete('/:id', oAuth2.authenticate, reqValidator.videosRemove, cacheMiddleware.cache(false), removeVideo) 47router.delete('/:id', oAuth2.authenticate, reqValidator.videosRemove, removeVideo)
49router.get('/search/:name', reqValidator.videosSearch, cacheMiddleware.cache(false), searchVideos) 48router.get('/search/:name', reqValidator.videosSearch, searchVideos)
50 49
51// --------------------------------------------------------------------------- 50// ---------------------------------------------------------------------------
52 51