aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-22 10:43:11 +0200
committerChocobozzz <me@florianbigard.com>2019-08-22 10:43:11 +0200
commit5c5e587307a27e173333789b5b5167d35f468b01 (patch)
tree94e3721caf2e11d38fd5f4112c0fc98da89ac535 /server/controllers/static.ts
parent1b42d73f44811eec1b7ddd72dd0d640a57c3376c (diff)
parentb5fecbf44192144d1ca27c23a0b53922de288c10 (diff)
downloadPeerTube-5c5e587307a27e173333789b5b5167d35f468b01.tar.gz
PeerTube-5c5e587307a27e173333789b5b5167d35f468b01.tar.zst
PeerTube-5c5e587307a27e173333789b5b5167d35f468b01.zip
Merge branch 'feature/strong-model-types' into develop
Diffstat (limited to 'server/controllers/static.ts')
-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 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) {
226 return res.send(json).end() 226 return res.send(json).end()
227} 227}
228 228
229async function downloadTorrent (req: express.Request, res: express.Response, next: express.NextFunction) { 229async function downloadTorrent (req: express.Request, res: express.Response) {
230 const { video, videoFile } = getVideoAndFile(req, res) 230 const { video, videoFile } = getVideoAndFile(req, res)
231 if (!videoFile) return res.status(404).end() 231 if (!videoFile) return res.status(404).end()
232 232
233 return res.download(video.getTorrentFilePath(videoFile), `${video.name}-${videoFile.resolution}p.torrent`) 233 return res.download(video.getTorrentFilePath(videoFile), `${video.name}-${videoFile.resolution}p.torrent`)
234} 234}
235 235
236async function downloadVideoFile (req: express.Request, res: express.Response, next: express.NextFunction) { 236async function downloadVideoFile (req: express.Request, res: express.Response) {
237 const { video, videoFile } = getVideoAndFile(req, res) 237 const { video, videoFile } = getVideoAndFile(req, res)
238 if (!videoFile) return res.status(404).end() 238 if (!videoFile) return res.status(404).end()
239 239
@@ -242,7 +242,7 @@ async function downloadVideoFile (req: express.Request, res: express.Response, n
242 242
243function getVideoAndFile (req: express.Request, res: express.Response) { 243function getVideoAndFile (req: express.Request, res: express.Response) {
244 const resolution = parseInt(req.params.resolution, 10) 244 const resolution = parseInt(req.params.resolution, 10)
245 const video = res.locals.video 245 const video = res.locals.videoAll
246 246
247 const videoFile = video.VideoFiles.find(f => f.resolution === resolution) 247 const videoFile = video.VideoFiles.find(f => f.resolution === resolution)
248 248