diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-09 10:14:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-09-09 10:14:33 +0200 |
commit | fb0f7f82e59c7138b5fa9d801296609b1c0cd971 (patch) | |
tree | cce4f9712a100f66e58b2800efece227f358ebf2 /server/lib/video-transcoding.ts | |
parent | b43d19cf44ef7391cfb83bfd0d20683518cc689f (diff) | |
download | PeerTube-fb0f7f82e59c7138b5fa9d801296609b1c0cd971.tar.gz PeerTube-fb0f7f82e59c7138b5fa9d801296609b1c0cd971.tar.zst PeerTube-fb0f7f82e59c7138b5fa9d801296609b1c0cd971.zip |
Fix re webtorrent transcoding
Diffstat (limited to 'server/lib/video-transcoding.ts')
-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 | } |