]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-transcoding.ts
Tests for totalRepliesFromVideoAuthor
[github/Chocobozzz/PeerTube.git] / server / lib / video-transcoding.ts
index ab5200936595b7ba7b4c41a9a40a7fecb7fbce50..4fd1d62a9140f0655d976741ebbcdae83d0919ff 100644 (file)
@@ -105,7 +105,7 @@ async function mergeAudioVideofile (video: MVideoWithAllFiles, resolution: Video
   const transcodeDirectory = CONFIG.STORAGE.TMP_DIR
   const newExtname = '.mp4'
 
-  const inputVideoFile = video.getMaxQualityFile()
+  const inputVideoFile = video.getMinQualityFile()
 
   const audioInputPath = getVideoFilePath(video, inputVideoFile)
   const videoTranscodedPath = join(transcodeDirectory, video.id + '-transcoded' + newExtname)
@@ -205,10 +205,8 @@ async function generateHlsPlaylist (video: MVideoWithFile, resolution: VideoReso
 
   await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile)
 
-  const updatedVideoFile = await newVideoFile.save()
-
+  await newVideoFile.save()
   videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles') as VideoFileModel[]
-  videoStreamingPlaylist.VideoFiles.push(updatedVideoFile)
 
   video.setHLSPlaylist(videoStreamingPlaylist)