diff options
Diffstat (limited to 'server/helpers/captions-utils.ts')
-rw-r--r-- | server/helpers/captions-utils.ts | 12 |
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 @@ | |||
1 | import { createReadStream, createWriteStream, move, remove } from 'fs-extra' | ||
1 | import { join } from 'path' | 2 | import { join } from 'path' |
2 | import { CONFIG } from '../initializers/config' | ||
3 | import * as srt2vtt from 'srt-to-vtt' | 3 | import * as srt2vtt from 'srt-to-vtt' |
4 | import { createReadStream, createWriteStream, move, remove } from 'fs-extra' | 4 | import { MVideoCaption } from '@server/types/models' |
5 | import { MVideoCaptionFormattable } from '@server/types/models' | 5 | import { CONFIG } from '../initializers/config' |
6 | 6 | ||
7 | async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) { | 7 | async 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 | ||