aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-31 16:56:52 +0100
committerChocobozzz <me@florianbigard.com>2020-02-03 08:31:02 +0100
commita15871560f80e07386c1dabb8370cd2664ecfd1f (patch)
tree44440e140c9e43b0d7f97ade777a76e649e0553d /server/controllers/static.ts
parenta22046d166805222ca76060e471b6cb3d419a32d (diff)
downloadPeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz
PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst
PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip
Move to eslintcontain
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index a4bb3a4d9..4c6cf9597 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -45,12 +45,12 @@ staticRouter.use(
45staticRouter.use( 45staticRouter.use(
46 STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+).torrent', 46 STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+).torrent',
47 asyncMiddleware(videosDownloadValidator), 47 asyncMiddleware(videosDownloadValidator),
48 asyncMiddleware(downloadTorrent) 48 downloadTorrent
49) 49)
50staticRouter.use( 50staticRouter.use(
51 STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+)-hls.torrent', 51 STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+)-hls.torrent',
52 asyncMiddleware(videosDownloadValidator), 52 asyncMiddleware(videosDownloadValidator),
53 asyncMiddleware(downloadHLSVideoFileTorrent) 53 downloadHLSVideoFileTorrent
54) 54)
55 55
56// Videos path for webseeding 56// Videos path for webseeding
@@ -68,13 +68,13 @@ staticRouter.use(
68staticRouter.use( 68staticRouter.use(
69 STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', 69 STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension',
70 asyncMiddleware(videosDownloadValidator), 70 asyncMiddleware(videosDownloadValidator),
71 asyncMiddleware(downloadVideoFile) 71 downloadVideoFile
72) 72)
73 73
74staticRouter.use( 74staticRouter.use(
75 STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension', 75 STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension',
76 asyncMiddleware(videosDownloadValidator), 76 asyncMiddleware(videosDownloadValidator),
77 asyncMiddleware(downloadHLSVideoFile) 77 downloadHLSVideoFile
78) 78)
79 79
80// HLS 80// HLS
@@ -325,7 +325,7 @@ async function generateNodeinfo (req: express.Request, res: express.Response) {
325 return res.send(json).end() 325 return res.send(json).end()
326} 326}
327 327
328async function downloadTorrent (req: express.Request, res: express.Response) { 328function downloadTorrent (req: express.Request, res: express.Response) {
329 const video = res.locals.videoAll 329 const video = res.locals.videoAll
330 330
331 const videoFile = getVideoFile(req, video.VideoFiles) 331 const videoFile = getVideoFile(req, video.VideoFiles)
@@ -334,7 +334,7 @@ async function downloadTorrent (req: express.Request, res: express.Response) {
334 return res.download(getTorrentFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p.torrent`) 334 return res.download(getTorrentFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p.torrent`)
335} 335}
336 336
337async function downloadHLSVideoFileTorrent (req: express.Request, res: express.Response) { 337function downloadHLSVideoFileTorrent (req: express.Request, res: express.Response) {
338 const video = res.locals.videoAll 338 const video = res.locals.videoAll
339 339
340 const playlist = getHLSPlaylist(video) 340 const playlist = getHLSPlaylist(video)
@@ -346,7 +346,7 @@ async function downloadHLSVideoFileTorrent (req: express.Request, res: express.R
346 return res.download(getTorrentFilePath(playlist, videoFile), `${video.name}-${videoFile.resolution}p-hls.torrent`) 346 return res.download(getTorrentFilePath(playlist, videoFile), `${video.name}-${videoFile.resolution}p-hls.torrent`)
347} 347}
348 348
349async function downloadVideoFile (req: express.Request, res: express.Response) { 349function downloadVideoFile (req: express.Request, res: express.Response) {
350 const video = res.locals.videoAll 350 const video = res.locals.videoAll
351 351
352 const videoFile = getVideoFile(req, video.VideoFiles) 352 const videoFile = getVideoFile(req, video.VideoFiles)
@@ -355,7 +355,7 @@ async function downloadVideoFile (req: express.Request, res: express.Response) {
355 return res.download(getVideoFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`) 355 return res.download(getVideoFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`)
356} 356}
357 357
358async function downloadHLSVideoFile (req: express.Request, res: express.Response) { 358function downloadHLSVideoFile (req: express.Request, res: express.Response) {
359 const video = res.locals.videoAll 359 const video = res.locals.videoAll
360 const playlist = getHLSPlaylist(video) 360 const playlist = getHLSPlaylist(video)
361 if (!playlist) return res.status(404).end 361 if (!playlist) return res.status(404).end