Use move instead rename

To avoid EXDEV errors
This commit is contained in:
Chocobozzz 2018-12-11 15:12:38 +01:00
parent 14e2014acc
commit f481c4f9f3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 10 additions and 10 deletions

View file

@ -1,7 +1,7 @@
import { CONFIG } from '../initializers'
import { extname, join } from 'path'
import { getVideoFileFPS, getVideoFileResolution, transcode } from '../helpers/ffmpeg-utils'
import { copy, remove, rename, stat } from 'fs-extra'
import { copy, remove, move, stat } from 'fs-extra'
import { logger } from '../helpers/logger'
import { VideoResolution } from '../../shared/models/videos'
import { VideoFileModel } from '../models/video/video-file'
@ -30,7 +30,7 @@ async function optimizeVideofile (video: VideoModel, inputVideoFileArg?: VideoFi
inputVideoFile.set('extname', newExtname)
const videoOutputPath = video.getVideoFilePath(inputVideoFile)
await rename(videoTranscodedPath, videoOutputPath)
await move(videoTranscodedPath, videoOutputPath)
const stats = await stat(videoOutputPath)
const fps = await getVideoFileFPS(videoOutputPath)