X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fstatic.ts;h=139ba67cc290b09db1c9867911f14f43669ee04b;hb=3cd0734fd9b0ff21aaef02317a874e8f1c06e027;hp=8bebe6fa7e836affbd43c347e9b8f2f03a2a0f97;hpb=02756fbd11190e75b8bed9fad5751027e2e0de49;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 8bebe6fa7..139ba67cc 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts @@ -77,20 +77,20 @@ async function getPreview (req: express.Request, res: express.Response, next: ex } async function downloadTorrent (req: express.Request, res: express.Response, next: express.NextFunction) { - const { video, videoFile } = getVideoAndFileOr404(req, res) + 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) { - const { video, videoFile } = getVideoAndFileOr404(req, res) + const { video, videoFile } = getVideoAndFile(req, res) if (!videoFile) return res.status(404).end() return res.download(video.getVideoFilePath(videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`) } -function getVideoAndFileOr404 (req: express.Request, res: express.Response) { +function getVideoAndFile (req: express.Request, res: express.Response) { const resolution = parseInt(req.params.resolution, 10) const video: VideoModel = res.locals.video