diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
commit | 784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (patch) | |
tree | 29c46cfd6344065eb805680ed080cb05592ee1d4 /server/controllers/object-storage-proxy.ts | |
parent | c3030e944ad03c7fd7b5d668a2d88ff03e4cdf19 (diff) | |
download | PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.gz PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.zst PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.zip |
Prefer web videos in favour of webtorrent
Diffstat (limited to 'server/controllers/object-storage-proxy.ts')
-rw-r--r-- | server/controllers/object-storage-proxy.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/object-storage-proxy.ts b/server/controllers/object-storage-proxy.ts index 8e2cc4af9..0edde64fe 100644 --- a/server/controllers/object-storage-proxy.ts +++ b/server/controllers/object-storage-proxy.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import cors from 'cors' | 1 | import cors from 'cors' |
2 | import express from 'express' | 2 | import express from 'express' |
3 | import { OBJECT_STORAGE_PROXY_PATHS } from '@server/initializers/constants' | 3 | import { OBJECT_STORAGE_PROXY_PATHS } from '@server/initializers/constants' |
4 | import { proxifyHLS, proxifyWebTorrentFile } from '@server/lib/object-storage' | 4 | import { proxifyHLS, proxifyWebVideoFile } from '@server/lib/object-storage' |
5 | import { | 5 | import { |
6 | asyncMiddleware, | 6 | asyncMiddleware, |
7 | ensureCanAccessPrivateVideoHLSFiles, | 7 | ensureCanAccessPrivateVideoHLSFiles, |
8 | ensureCanAccessVideoPrivateWebTorrentFiles, | 8 | ensureCanAccessVideoPrivateWebVideoFiles, |
9 | ensurePrivateObjectStorageProxyIsEnabled, | 9 | ensurePrivateObjectStorageProxyIsEnabled, |
10 | optionalAuthenticate | 10 | optionalAuthenticate |
11 | } from '@server/middlewares' | 11 | } from '@server/middlewares' |
@@ -18,8 +18,8 @@ objectStorageProxyRouter.use(cors()) | |||
18 | objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.PRIVATE_WEBSEED + ':filename', | 18 | objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.PRIVATE_WEBSEED + ':filename', |
19 | ensurePrivateObjectStorageProxyIsEnabled, | 19 | ensurePrivateObjectStorageProxyIsEnabled, |
20 | optionalAuthenticate, | 20 | optionalAuthenticate, |
21 | asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles), | 21 | asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles), |
22 | asyncMiddleware(proxifyWebTorrentController) | 22 | asyncMiddleware(proxifyWebVideoController) |
23 | ) | 23 | ) |
24 | 24 | ||
25 | objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.STREAMING_PLAYLISTS.PRIVATE_HLS + ':videoUUID/:filename', | 25 | objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.STREAMING_PLAYLISTS.PRIVATE_HLS + ':videoUUID/:filename', |
@@ -35,10 +35,10 @@ export { | |||
35 | objectStorageProxyRouter | 35 | objectStorageProxyRouter |
36 | } | 36 | } |
37 | 37 | ||
38 | function proxifyWebTorrentController (req: express.Request, res: express.Response) { | 38 | function proxifyWebVideoController (req: express.Request, res: express.Response) { |
39 | const filename = req.params.filename | 39 | const filename = req.params.filename |
40 | 40 | ||
41 | return proxifyWebTorrentFile({ req, res, filename }) | 41 | return proxifyWebVideoFile({ req, res, filename }) |
42 | } | 42 | } |
43 | 43 | ||
44 | function proxifyHLSController (req: express.Request, res: express.Response) { | 44 | function proxifyHLSController (req: express.Request, res: express.Response) { |