aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/videos/import.ts21
1 files changed, 1 insertions, 20 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts
index 680d8665f..ca7a5f9ca 100644
--- a/server/controllers/api/videos/import.ts
+++ b/server/controllers/api/videos/import.ts
@@ -4,8 +4,7 @@ import {
4 asyncMiddleware, 4 asyncMiddleware,
5 asyncRetryTransactionMiddleware, 5 asyncRetryTransactionMiddleware,
6 authenticate, 6 authenticate,
7 videoImportAddValidator, 7 videoImportAddValidator
8 videoImportDeleteValidator
9} from '../../../middlewares' 8} from '../../../middlewares'
10import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers' 9import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers'
11import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl' 10import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl'
@@ -39,12 +38,6 @@ videoImportsRouter.post('/imports',
39 asyncRetryTransactionMiddleware(addVideoImport) 38 asyncRetryTransactionMiddleware(addVideoImport)
40) 39)
41 40
42videoImportsRouter.delete('/imports/:id',
43 authenticate,
44 asyncMiddleware(videoImportDeleteValidator),
45 asyncRetryTransactionMiddleware(deleteVideoImport)
46)
47
48// --------------------------------------------------------------------------- 41// ---------------------------------------------------------------------------
49 42
50export { 43export {
@@ -145,15 +138,3 @@ async function addVideoImport (req: express.Request, res: express.Response) {
145 138
146 return res.json(videoImport.toFormattedJSON()) 139 return res.json(videoImport.toFormattedJSON())
147} 140}
148
149async function deleteVideoImport (req: express.Request, res: express.Response) {
150 await sequelizeTypescript.transaction(async t => {
151 const videoImport = res.locals.videoImport
152 const video = videoImport.Video
153
154 await videoImport.destroy({ transaction: t })
155 await video.destroy({ transaction: t })
156 })
157
158 return res.status(204).end()
159}