diff options
Diffstat (limited to 'server/controllers/api/v1/videos.js')
-rw-r--r-- | server/controllers/api/v1/videos.js | 11 |
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') | |||
11 | const friends = require('../../../lib/friends') | 11 | const friends = require('../../../lib/friends') |
12 | const middleware = require('../../../middlewares') | 12 | const middleware = require('../../../middlewares') |
13 | const oAuth2 = require('../../../middlewares/oauth2') | 13 | const oAuth2 = require('../../../middlewares/oauth2') |
14 | const cacheMiddleware = middleware.cache | ||
15 | const reqValidator = middleware.reqValidators.videos | 14 | const reqValidator = middleware.reqValidators.videos |
16 | const utils = require('../../../helpers/utils') | 15 | const utils = require('../../../helpers/utils') |
17 | const Videos = require('../../../models/videos') // model | 16 | const Videos = require('../../../models/videos') // model |
@@ -42,11 +41,11 @@ const storage = multer.diskStorage({ | |||
42 | const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }]) | 41 | const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }]) |
43 | const thumbnailsDir = path.join(__dirname, '..', '..', '..', '..', config.get('storage.thumbnails')) | 42 | const thumbnailsDir = path.join(__dirname, '..', '..', '..', '..', config.get('storage.thumbnails')) |
44 | 43 | ||
45 | router.get('/', cacheMiddleware.cache(false), listVideos) | 44 | router.get('/', listVideos) |
46 | router.post('/', oAuth2.authenticate, reqFiles, reqValidator.videosAdd, cacheMiddleware.cache(false), addVideo) | 45 | router.post('/', oAuth2.authenticate, reqFiles, reqValidator.videosAdd, addVideo) |
47 | router.get('/:id', reqValidator.videosGet, cacheMiddleware.cache(false), getVideos) | 46 | router.get('/:id', reqValidator.videosGet, getVideos) |
48 | router.delete('/:id', oAuth2.authenticate, reqValidator.videosRemove, cacheMiddleware.cache(false), removeVideo) | 47 | router.delete('/:id', oAuth2.authenticate, reqValidator.videosRemove, removeVideo) |
49 | router.get('/search/:name', reqValidator.videosSearch, cacheMiddleware.cache(false), searchVideos) | 48 | router.get('/search/:name', reqValidator.videosSearch, searchVideos) |
50 | 49 | ||
51 | // --------------------------------------------------------------------------- | 50 | // --------------------------------------------------------------------------- |
52 | 51 | ||