aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts23
1 files changed, 0 insertions, 23 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index bbb5b8b4c..547522123 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -38,7 +38,6 @@ import {
38 videosAddValidator, 38 videosAddValidator,
39 videosGetValidator, 39 videosGetValidator,
40 videosRemoveValidator, 40 videosRemoveValidator,
41 videosSearchValidator,
42 videosSortValidator, 41 videosSortValidator,
43 videosUpdateValidator 42 videosUpdateValidator
44} from '../../../middlewares' 43} from '../../../middlewares'
@@ -50,7 +49,6 @@ import { blacklistRouter } from './blacklist'
50import { videoCommentRouter } from './comment' 49import { videoCommentRouter } from './comment'
51import { rateVideoRouter } from './rate' 50import { rateVideoRouter } from './rate'
52import { VideoFilter } from '../../../../shared/models/videos/video-query.type' 51import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
53import { VideoSortField } from '../../../../client/src/app/shared/video/sort-field.type'
54import { createReqFiles, isNSFWHidden } from '../../../helpers/express-utils' 52import { createReqFiles, isNSFWHidden } from '../../../helpers/express-utils'
55import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' 53import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update'
56import { videoCaptionsRouter } from './captions' 54import { videoCaptionsRouter } from './captions'
@@ -94,15 +92,6 @@ videosRouter.get('/',
94 optionalAuthenticate, 92 optionalAuthenticate,
95 asyncMiddleware(listVideos) 93 asyncMiddleware(listVideos)
96) 94)
97videosRouter.get('/search',
98 videosSearchValidator,
99 paginationValidator,
100 videosSortValidator,
101 setDefaultSort,
102 setDefaultPagination,
103 optionalAuthenticate,
104 asyncMiddleware(searchVideos)
105)
106videosRouter.put('/:id', 95videosRouter.put('/:id',
107 authenticate, 96 authenticate,
108 reqVideoFileUpdate, 97 reqVideoFileUpdate,
@@ -432,15 +421,3 @@ async function removeVideo (req: express.Request, res: express.Response) {
432 421
433 return res.type('json').status(204).end() 422 return res.type('json').status(204).end()
434} 423}
435
436async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
437 const resultList = await VideoModel.searchAndPopulateAccountAndServer(
438 req.query.search as string,
439 req.query.start as number,
440 req.query.count as number,
441 req.query.sort as VideoSortField,
442 isNSFWHidden(res)
443 )
444
445 return res.json(getFormattedObjects(resultList.data, resultList.total))
446}