diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-11 15:12:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-11 15:12:38 +0100 |
commit | f481c4f9f31e897a08e818f388fecdee07f57142 (patch) | |
tree | 2a47adb746d7bfc5046fa7e610408223c921db83 /server/lib/video-transcoding.ts | |
parent | 14e2014acc1362cfbb770c051a7254b156cd8efb (diff) | |
download | PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.tar.gz PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.tar.zst PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.zip |
Use move instead rename
To avoid EXDEV errors
Diffstat (limited to 'server/lib/video-transcoding.ts')
-rw-r--r-- | server/lib/video-transcoding.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index a78de61e5..4460f46e4 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { CONFIG } from '../initializers' | 1 | import { CONFIG } from '../initializers' |
2 | import { extname, join } from 'path' | 2 | import { extname, join } from 'path' |
3 | import { getVideoFileFPS, getVideoFileResolution, transcode } from '../helpers/ffmpeg-utils' | 3 | import { getVideoFileFPS, getVideoFileResolution, transcode } from '../helpers/ffmpeg-utils' |
4 | import { copy, remove, rename, stat } from 'fs-extra' | 4 | import { copy, remove, move, stat } from 'fs-extra' |
5 | import { logger } from '../helpers/logger' | 5 | import { logger } from '../helpers/logger' |
6 | import { VideoResolution } from '../../shared/models/videos' | 6 | import { VideoResolution } from '../../shared/models/videos' |
7 | import { VideoFileModel } from '../models/video/video-file' | 7 | import { VideoFileModel } from '../models/video/video-file' |
@@ -30,7 +30,7 @@ async function optimizeVideofile (video: VideoModel, inputVideoFileArg?: VideoFi | |||
30 | inputVideoFile.set('extname', newExtname) | 30 | inputVideoFile.set('extname', newExtname) |
31 | 31 | ||
32 | const videoOutputPath = video.getVideoFilePath(inputVideoFile) | 32 | const videoOutputPath = video.getVideoFilePath(inputVideoFile) |
33 | await rename(videoTranscodedPath, videoOutputPath) | 33 | await move(videoTranscodedPath, videoOutputPath) |
34 | const stats = await stat(videoOutputPath) | 34 | const stats = await stat(videoOutputPath) |
35 | const fps = await getVideoFileFPS(videoOutputPath) | 35 | const fps = await getVideoFileFPS(videoOutputPath) |
36 | 36 | ||