X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fstatic.ts;h=0f47723100ef165f9f290553b76dba237e1f6293;hb=d5c8932a601c1854db0a2e399ccaf26e17385f1a;hp=8979ef5f388e16b6f487a7a73b7fdde12ba427ac;hpb=557b13ae24019d9ab214bbea7eaa0f892c8f4b05;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 8979ef5f3..0f4772310 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts @@ -226,14 +226,14 @@ async function generateNodeinfo (req: express.Request, res: express.Response) { return res.send(json).end() } -async function downloadTorrent (req: express.Request, res: express.Response, next: express.NextFunction) { +async function downloadTorrent (req: express.Request, res: express.Response) { const { video, videoFile } = getVideoAndFile(req, res) if (!videoFile) return res.status(404).end() return res.download(video.getTorrentFilePath(videoFile), `${video.name}-${videoFile.resolution}p.torrent`) } -async function downloadVideoFile (req: express.Request, res: express.Response, next: express.NextFunction) { +async function downloadVideoFile (req: express.Request, res: express.Response) { const { video, videoFile } = getVideoAndFile(req, res) if (!videoFile) return res.status(404).end() @@ -242,7 +242,7 @@ async function downloadVideoFile (req: express.Request, res: express.Response, n function getVideoAndFile (req: express.Request, res: express.Response) { const resolution = parseInt(req.params.resolution, 10) - const video = res.locals.video + const video = res.locals.videoAll const videoFile = video.VideoFiles.find(f => f.resolution === resolution)