Browse Source

Fix re webtorrent transcoding

pull/3150/head
Chocobozzz 2 weeks ago
parent
commit
fb0f7f82e5
No known key found for this signature in database GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 7 deletions
  1. +3
    -7
      server/lib/video-transcoding.ts

+ 3
- 7
server/lib/video-transcoding.ts View File

@@ -234,7 +234,7 @@ async function onVideoFileTranscoding (video: MVideoWithFile, videoFile: MVideoF
const fps = await getVideoFileFPS(transcodingPath)
const metadata = await getMetadataFromFile(transcodingPath)

await move(transcodingPath, outputPath)
await move(transcodingPath, outputPath, { overwrite: true })

videoFile.size = stats.size
videoFile.fps = fps
@@ -242,12 +242,8 @@ async function onVideoFileTranscoding (video: MVideoWithFile, videoFile: MVideoF

await createTorrentAndSetInfoHash(video, videoFile)

const updatedVideoFile = await videoFile.save()

// Add it if this is a new created file
if (video.VideoFiles.some(f => f.id === videoFile.id) === false) {
video.VideoFiles.push(updatedVideoFile)
}
await VideoFileModel.customUpsert(videoFile, 'video', undefined)
video.VideoFiles = await video.$get('VideoFiles')

return video
}

Loading…
Cancel
Save