aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
commit62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch)
treec45c35d35d7a3e32621fba06edc63646930c8efd /server/controllers/api/videos/index.ts
parent84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff)
downloadPeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.gz
PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.zst
PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.zip
Correctly migrate to fs-extra
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts4
1 files changed, 2 insertions, 2 deletions
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import { extname, join } from 'path' 2import { extname, join } from 'path'
3import { VideoCreate, VideoPrivacy, VideoState, VideoUpdate } from '../../../../shared' 3import { VideoCreate, VideoPrivacy, VideoState, VideoUpdate } from '../../../../shared'
4import { renamePromise } from '../../../helpers/core-utils'
5import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' 4import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils'
6import { processImage } from '../../../helpers/image-utils' 5import { processImage } from '../../../helpers/image-utils'
7import { logger } from '../../../helpers/logger' 6import { logger } from '../../../helpers/logger'
@@ -56,6 +55,7 @@ import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-u
56import { videoCaptionsRouter } from './captions' 55import { videoCaptionsRouter } from './captions'
57import { videoImportsRouter } from './import' 56import { videoImportsRouter } from './import'
58import { resetSequelizeInstance } from '../../../helpers/database-utils' 57import { resetSequelizeInstance } from '../../../helpers/database-utils'
58import { rename } from 'fs-extra'
59 59
60const auditLogger = auditLoggerFactory('videos') 60const auditLogger = auditLoggerFactory('videos')
61const videosRouter = express.Router() 61const videosRouter = express.Router()
@@ -194,7 +194,7 @@ async function addVideo (req: express.Request, res: express.Response) {
194 // Move physical file 194 // Move physical file
195 const videoDir = CONFIG.STORAGE.VIDEOS_DIR 195 const videoDir = CONFIG.STORAGE.VIDEOS_DIR
196 const destination = join(videoDir, video.getVideoFilename(videoFile)) 196 const destination = join(videoDir, video.getVideoFilename(videoFile))
197 await renamePromise(videoPhysicalFile.path, destination) 197 await rename(videoPhysicalFile.path, destination)
198 // This is important in case if there is another attempt in the retry process 198 // This is important in case if there is another attempt in the retry process
199 videoPhysicalFile.filename = video.getVideoFilename(videoFile) 199 videoPhysicalFile.filename = video.getVideoFilename(videoFile)
200 videoPhysicalFile.path = destination 200 videoPhysicalFile.path = destination