aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-29 18:35:01 +0200
committerChocobozzz <me@florianbigard.com>2018-05-29 18:35:01 +0200
commit9118bca30759a2cc2584cde0bbca13466af735fb (patch)
treea59853ddb0518ed39600394bb7a59ddd26a2be47 /server/controllers
parent02756fbd11190e75b8bed9fad5751027e2e0de49 (diff)
downloadPeerTube-9118bca30759a2cc2584cde0bbca13466af735fb.tar.gz
PeerTube-9118bca30759a2cc2584cde0bbca13466af735fb.tar.zst
PeerTube-9118bca30759a2cc2584cde0bbca13466af735fb.zip
Fix static function name
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/static.ts6
1 files changed, 3 insertions, 3 deletions
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
77} 77}
78 78
79async function downloadTorrent (req: express.Request, res: express.Response, next: express.NextFunction) { 79async function downloadTorrent (req: express.Request, res: express.Response, next: express.NextFunction) {
80 const { video, videoFile } = getVideoAndFileOr404(req, res) 80 const { video, videoFile } = getVideoAndFile(req, res)
81 if (!videoFile) return res.status(404).end() 81 if (!videoFile) return res.status(404).end()
82 82
83 return res.download(video.getTorrentFilePath(videoFile), `${video.name}-${videoFile.resolution}p.torrent`) 83 return res.download(video.getTorrentFilePath(videoFile), `${video.name}-${videoFile.resolution}p.torrent`)
84} 84}
85 85
86async function downloadVideoFile (req: express.Request, res: express.Response, next: express.NextFunction) { 86async function downloadVideoFile (req: express.Request, res: express.Response, next: express.NextFunction) {
87 const { video, videoFile } = getVideoAndFileOr404(req, res) 87 const { video, videoFile } = getVideoAndFile(req, res)
88 if (!videoFile) return res.status(404).end() 88 if (!videoFile) return res.status(404).end()
89 89
90 return res.download(video.getVideoFilePath(videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`) 90 return res.download(video.getVideoFilePath(videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`)
91} 91}
92 92
93function getVideoAndFileOr404 (req: express.Request, res: express.Response) { 93function getVideoAndFile (req: express.Request, res: express.Response) {
94 const resolution = parseInt(req.params.resolution, 10) 94 const resolution = parseInt(req.params.resolution, 10)
95 const video: VideoModel = res.locals.video 95 const video: VideoModel = res.locals.video
96 96