diff options
-rw-r--r-- | server/lib/video-transcoding.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index 628f22f5e..5a2dbc9f7 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts | |||
@@ -234,7 +234,7 @@ async function onVideoFileTranscoding (video: MVideoWithFile, videoFile: MVideoF | |||
234 | const fps = await getVideoFileFPS(transcodingPath) | 234 | const fps = await getVideoFileFPS(transcodingPath) |
235 | const metadata = await getMetadataFromFile(transcodingPath) | 235 | const metadata = await getMetadataFromFile(transcodingPath) |
236 | 236 | ||
237 | await move(transcodingPath, outputPath) | 237 | await move(transcodingPath, outputPath, { overwrite: true }) |
238 | 238 | ||
239 | videoFile.size = stats.size | 239 | videoFile.size = stats.size |
240 | videoFile.fps = fps | 240 | videoFile.fps = fps |
@@ -242,12 +242,8 @@ async function onVideoFileTranscoding (video: MVideoWithFile, videoFile: MVideoF | |||
242 | 242 | ||
243 | await createTorrentAndSetInfoHash(video, videoFile) | 243 | await createTorrentAndSetInfoHash(video, videoFile) |
244 | 244 | ||
245 | const updatedVideoFile = await videoFile.save() | 245 | await VideoFileModel.customUpsert(videoFile, 'video', undefined) |
246 | 246 | video.VideoFiles = await video.$get('VideoFiles') | |
247 | // Add it if this is a new created file | ||
248 | if (video.VideoFiles.some(f => f.id === videoFile.id) === false) { | ||
249 | video.VideoFiles.push(updatedVideoFile) | ||
250 | } | ||
251 | 247 | ||
252 | return video | 248 | return video |
253 | } | 249 | } |