diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-29 18:35:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-29 18:35:01 +0200 |
commit | 9118bca30759a2cc2584cde0bbca13466af735fb (patch) | |
tree | a59853ddb0518ed39600394bb7a59ddd26a2be47 /server/controllers/static.ts | |
parent | 02756fbd11190e75b8bed9fad5751027e2e0de49 (diff) | |
download | PeerTube-9118bca30759a2cc2584cde0bbca13466af735fb.tar.gz PeerTube-9118bca30759a2cc2584cde0bbca13466af735fb.tar.zst PeerTube-9118bca30759a2cc2584cde0bbca13466af735fb.zip |
Fix static function name
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 6 |
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 | ||
79 | async function downloadTorrent (req: express.Request, res: express.Response, next: express.NextFunction) { | 79 | async 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 | ||
86 | async function downloadVideoFile (req: express.Request, res: express.Response, next: express.NextFunction) { | 86 | async 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 | ||
93 | function getVideoAndFileOr404 (req: express.Request, res: express.Response) { | 93 | function 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 | ||