aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/captions-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/captions-utils.ts')
-rw-r--r--server/helpers/captions-utils.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/helpers/captions-utils.ts b/server/helpers/captions-utils.ts
index 7cbfb3561..401f2fb7b 100644
--- a/server/helpers/captions-utils.ts
+++ b/server/helpers/captions-utils.ts
@@ -1,12 +1,12 @@
1import { createReadStream, createWriteStream, move, remove } from 'fs-extra'
1import { join } from 'path' 2import { join } from 'path'
2import { CONFIG } from '../initializers/config'
3import * as srt2vtt from 'srt-to-vtt' 3import * as srt2vtt from 'srt-to-vtt'
4import { createReadStream, createWriteStream, move, remove } from 'fs-extra' 4import { MVideoCaption } from '@server/types/models'
5import { MVideoCaptionFormattable } from '@server/types/models' 5import { CONFIG } from '../initializers/config'
6 6
7async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) { 7async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaption) {
8 const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR 8 const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR
9 const destination = join(videoCaptionsDir, videoCaption.getCaptionName()) 9 const destination = join(videoCaptionsDir, videoCaption.filename)
10 10
11 // Convert this srt file to vtt 11 // Convert this srt file to vtt
12 if (physicalFile.path.endsWith('.srt')) { 12 if (physicalFile.path.endsWith('.srt')) {
@@ -17,7 +17,7 @@ async function moveAndProcessCaptionFile (physicalFile: { filename: string, path
17 } 17 }
18 18
19 // This is important in case if there is another attempt in the retry process 19 // This is important in case if there is another attempt in the retry process
20 physicalFile.filename = videoCaption.getCaptionName() 20 physicalFile.filename = videoCaption.filename
21 physicalFile.path = destination 21 physicalFile.path = destination
22} 22}
23 23