aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/captions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/captions.ts')
-rw-r--r--server/controllers/api/videos/captions.ts7
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'
5import { CONFIG, MIMETYPES, sequelizeTypescript } from '../../../initializers' 5import { CONFIG, MIMETYPES, sequelizeTypescript } from '../../../initializers'
6import { getFormattedObjects } from '../../../helpers/utils' 6import { getFormattedObjects } from '../../../helpers/utils'
7import { VideoCaptionModel } from '../../../models/video/video-caption' 7import { VideoCaptionModel } from '../../../models/video/video-caption'
8import { VideoModel } from '../../../models/video/video'
9import { logger } from '../../../helpers/logger' 8import { logger } from '../../../helpers/logger'
10import { federateVideoIfNeeded } from '../../../lib/activitypub' 9import { federateVideoIfNeeded } from '../../../lib/activitypub'
11import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' 10import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
@@ -52,7 +51,7 @@ async function listVideoCaptions (req: express.Request, res: express.Response) {
52 51
53async function addVideoCaption (req: express.Request, res: express.Response) { 52async 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
76async function deleteVideoCaption (req: express.Request, res: express.Response) { 75async 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 })