]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/download.ts
Add ability to run transcoding jobs
[github/Chocobozzz/PeerTube.git] / server / controllers / download.ts
index 8da710669c6400ee791b2bf1fb5b86d5343ae3ea..43d525f83a0de14ed9f24bffe348b704e31941fd 100644 (file)
@@ -85,7 +85,7 @@ async function downloadVideoFile (req: express.Request, res: express.Response) {
     return res.redirect(videoFile.getObjectStorageUrl())
   }
 
-  await VideoPathManager.Instance.makeAvailableVideoFile(video, videoFile, path => {
+  await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => {
     const filename = `${video.name}-${videoFile.resolution}p${videoFile.extname}`
 
     return res.download(path, filename)
@@ -119,7 +119,7 @@ async function downloadHLSVideoFile (req: express.Request, res: express.Response
     return res.redirect(videoFile.getObjectStorageUrl())
   }
 
-  await VideoPathManager.Instance.makeAvailableVideoFile(streamingPlaylist, videoFile, path => {
+  await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(streamingPlaylist), path => {
     const filename = `${video.name}-${videoFile.resolution}p-${streamingPlaylist.getStringType()}${videoFile.extname}`
 
     return res.download(path, filename)