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/lib/job-queue/handlers/video-import.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/job-queue') diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index d6984ef92..ebcb2090c 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts @@ -6,7 +6,6 @@ import { VideoImportState } from '../../../../shared/models/videos' import { getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' import { extname, join } from 'path' import { VideoFileModel } from '../../../models/video/video-file' -import { renamePromise, statPromise, unlinkPromise } from '../../../helpers/core-utils' import { CONFIG, sequelizeTypescript } from '../../../initializers' import { doRequestAndSaveToFile } from '../../../helpers/requests' import { VideoState } from '../../../../shared' @@ -15,6 +14,7 @@ import { federateVideoIfNeeded } from '../../activitypub' import { VideoModel } from '../../../models/video/video' import { downloadWebTorrentVideo } from '../../../helpers/webtorrent' import { getSecureTorrentName } from '../../../helpers/utils' +import { rename, stat } from 'fs-extra' type VideoImportYoutubeDLPayload = { type: 'youtube-dl' @@ -114,7 +114,7 @@ async function processFile (downloader: () => Promise, videoImport: Vide tempVideoPath = await downloader() // Get information about this video - const stats = await statPromise(tempVideoPath) + const stats = await stat(tempVideoPath) const isAble = await videoImport.User.isAbleToUploadVideo({ size: stats.size }) if (isAble === false) { throw new Error('The user video quota is exceeded with this video to import.') @@ -138,7 +138,7 @@ async function processFile (downloader: () => Promise, videoImport: Vide // Move file videoDestFile = join(CONFIG.STORAGE.VIDEOS_DIR, videoImport.Video.getVideoFilename(videoFile)) - await renamePromise(tempVideoPath, videoDestFile) + await rename(tempVideoPath, videoDestFile) tempVideoPath = null // This path is not used anymore // Process thumbnail -- cgit v1.2.3