aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/captions-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-11 15:12:38 +0100
committerChocobozzz <me@florianbigard.com>2018-12-11 15:12:38 +0100
commitf481c4f9f31e897a08e818f388fecdee07f57142 (patch)
tree2a47adb746d7bfc5046fa7e610408223c921db83 /server/helpers/captions-utils.ts
parent14e2014acc1362cfbb770c051a7254b156cd8efb (diff)
downloadPeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.tar.gz
PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.tar.zst
PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.zip
Use move instead rename
To avoid EXDEV errors
Diffstat (limited to 'server/helpers/captions-utils.ts')
-rw-r--r--server/helpers/captions-utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/captions-utils.ts b/server/helpers/captions-utils.ts
index 660dce65c..1aafbf805 100644
--- a/server/helpers/captions-utils.ts
+++ b/server/helpers/captions-utils.ts
@@ -2,7 +2,7 @@ import { join } from 'path'
2import { CONFIG } from '../initializers' 2import { CONFIG } from '../initializers'
3import { VideoCaptionModel } from '../models/video/video-caption' 3import { VideoCaptionModel } from '../models/video/video-caption'
4import * as srt2vtt from 'srt-to-vtt' 4import * as srt2vtt from 'srt-to-vtt'
5import { createReadStream, createWriteStream, remove, rename } from 'fs-extra' 5import { createReadStream, createWriteStream, remove, move } from 'fs-extra'
6 6
7async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: VideoCaptionModel) { 7async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: VideoCaptionModel) {
8 const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR 8 const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR
@@ -13,7 +13,7 @@ async function moveAndProcessCaptionFile (physicalFile: { filename: string, path
13 await convertSrtToVtt(physicalFile.path, destination) 13 await convertSrtToVtt(physicalFile.path, destination)
14 await remove(physicalFile.path) 14 await remove(physicalFile.path)
15 } else { // Just move the vtt file 15 } else { // Just move the vtt file
16 await rename(physicalFile.path, destination) 16 await move(physicalFile.path, destination)
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