From 62689b942b71cd1dd0d050c6ed05f884a0b325c2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Aug 2018 16:23:34 +0200 Subject: Correctly migrate to fs-extra --- server/controllers/api/videos/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/videos/index.ts') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index e973aa43f..a86cf4f99 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -1,7 +1,6 @@ import * as express from 'express' import { extname, join } from 'path' import { VideoCreate, VideoPrivacy, VideoState, VideoUpdate } from '../../../../shared' -import { renamePromise } from '../../../helpers/core-utils' import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' import { processImage } from '../../../helpers/image-utils' import { logger } from '../../../helpers/logger' @@ -56,6 +55,7 @@ import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-u import { videoCaptionsRouter } from './captions' import { videoImportsRouter } from './import' import { resetSequelizeInstance } from '../../../helpers/database-utils' +import { rename } from 'fs-extra' const auditLogger = auditLoggerFactory('videos') const videosRouter = express.Router() @@ -194,7 +194,7 @@ async function addVideo (req: express.Request, res: express.Response) { // Move physical file const videoDir = CONFIG.STORAGE.VIDEOS_DIR const destination = join(videoDir, video.getVideoFilename(videoFile)) - await renamePromise(videoPhysicalFile.path, destination) + await rename(videoPhysicalFile.path, destination) // This is important in case if there is another attempt in the retry process videoPhysicalFile.filename = video.getVideoFilename(videoFile) videoPhysicalFile.path = destination -- cgit v1.2.3