diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:35:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:35:15 +0100 |
commit | dae86118ed5d4026d04acb9d0e36829b9ad8eb4e (patch) | |
tree | a5bf9c4487240bf75a9b328cad459a0587f90dea /server/controllers/api/videos/captions.ts | |
parent | e65c0c5b1fab9c3d93f51721b2458cf5cf471f20 (diff) | |
download | PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.tar.gz PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.tar.zst PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.zip |
Cleanup express locals typings
Diffstat (limited to 'server/controllers/api/videos/captions.ts')
-rw-r--r-- | server/controllers/api/videos/captions.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts index 9b3661368..2694577d8 100644 --- a/server/controllers/api/videos/captions.ts +++ b/server/controllers/api/videos/captions.ts | |||
@@ -5,7 +5,6 @@ import { createReqFiles } from '../../../helpers/express-utils' | |||
5 | import { CONFIG, MIMETYPES, sequelizeTypescript } from '../../../initializers' | 5 | import { CONFIG, MIMETYPES, sequelizeTypescript } from '../../../initializers' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 7 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
8 | import { VideoModel } from '../../../models/video/video' | ||
9 | import { logger } from '../../../helpers/logger' | 8 | import { logger } from '../../../helpers/logger' |
10 | import { federateVideoIfNeeded } from '../../../lib/activitypub' | 9 | import { federateVideoIfNeeded } from '../../../lib/activitypub' |
11 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | 10 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' |
@@ -52,7 +51,7 @@ async function listVideoCaptions (req: express.Request, res: express.Response) { | |||
52 | 51 | ||
53 | async function addVideoCaption (req: express.Request, res: express.Response) { | 52 | async function addVideoCaption (req: express.Request, res: express.Response) { |
54 | const videoCaptionPhysicalFile = req.files['captionfile'][0] | 53 | const videoCaptionPhysicalFile = req.files['captionfile'][0] |
55 | const video = res.locals.video as VideoModel | 54 | const video = res.locals.video |
56 | 55 | ||
57 | const videoCaption = new VideoCaptionModel({ | 56 | const videoCaption = new VideoCaptionModel({ |
58 | videoId: video.id, | 57 | videoId: video.id, |
@@ -74,8 +73,8 @@ async function addVideoCaption (req: express.Request, res: express.Response) { | |||
74 | } | 73 | } |
75 | 74 | ||
76 | async function deleteVideoCaption (req: express.Request, res: express.Response) { | 75 | async function deleteVideoCaption (req: express.Request, res: express.Response) { |
77 | const video = res.locals.video as VideoModel | 76 | const video = res.locals.video |
78 | const videoCaption = res.locals.videoCaption as VideoCaptionModel | 77 | const videoCaption = res.locals.videoCaption |
79 | 78 | ||
80 | await sequelizeTypescript.transaction(async t => { | 79 | await sequelizeTypescript.transaction(async t => { |
81 | await videoCaption.destroy({ transaction: t }) | 80 | await videoCaption.destroy({ transaction: t }) |