diff options
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 }) |