From f481c4f9f31e897a08e818f388fecdee07f57142 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Dec 2018 15:12:38 +0100 Subject: Use move instead rename To avoid EXDEV errors --- server/helpers/captions-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers/captions-utils.ts') 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' import { CONFIG } from '../initializers' import { VideoCaptionModel } from '../models/video/video-caption' import * as srt2vtt from 'srt-to-vtt' -import { createReadStream, createWriteStream, remove, rename } from 'fs-extra' +import { createReadStream, createWriteStream, remove, move } from 'fs-extra' async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: VideoCaptionModel) { const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR @@ -13,7 +13,7 @@ async function moveAndProcessCaptionFile (physicalFile: { filename: string, path await convertSrtToVtt(physicalFile.path, destination) await remove(physicalFile.path) } else { // Just move the vtt file - await rename(physicalFile.path, destination) + await move(physicalFile.path, destination) } // This is important in case if there is another attempt in the retry process -- cgit v1.2.3