diff options
Diffstat (limited to 'server/lib/object-storage/videos.ts')
-rw-r--r-- | server/lib/object-storage/videos.ts | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.ts index 9152c5352..300c1f7e1 100644 --- a/server/lib/object-storage/videos.ts +++ b/server/lib/object-storage/videos.ts | |||
@@ -4,7 +4,7 @@ import { CONFIG } from '@server/initializers/config' | |||
4 | import { MStreamingPlaylistVideo, MVideo, MVideoFile } from '@server/types/models' | 4 | import { MStreamingPlaylistVideo, MVideo, MVideoFile } from '@server/types/models' |
5 | import { getHLSDirectory } from '../paths' | 5 | import { getHLSDirectory } from '../paths' |
6 | import { VideoPathManager } from '../video-path-manager' | 6 | import { VideoPathManager } from '../video-path-manager' |
7 | import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' | 7 | import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebVideoObjectStorageKey } from './keys' |
8 | import { | 8 | import { |
9 | createObjectReadStream, | 9 | createObjectReadStream, |
10 | listKeysOfPrefix, | 10 | listKeysOfPrefix, |
@@ -55,10 +55,10 @@ function storeHLSFileFromContent (playlist: MStreamingPlaylistVideo, path: strin | |||
55 | 55 | ||
56 | // --------------------------------------------------------------------------- | 56 | // --------------------------------------------------------------------------- |
57 | 57 | ||
58 | function storeWebTorrentFile (video: MVideo, file: MVideoFile) { | 58 | function storeWebVideoFile (video: MVideo, file: MVideoFile) { |
59 | return storeObject({ | 59 | return storeObject({ |
60 | inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file), | 60 | inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file), |
61 | objectStorageKey: generateWebTorrentObjectStorageKey(file.filename), | 61 | objectStorageKey: generateWebVideoObjectStorageKey(file.filename), |
62 | bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, | 62 | bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, |
63 | isPrivate: video.hasPrivateStaticPath() | 63 | isPrivate: video.hasPrivateStaticPath() |
64 | }) | 64 | }) |
@@ -66,9 +66,9 @@ function storeWebTorrentFile (video: MVideo, file: MVideoFile) { | |||
66 | 66 | ||
67 | // --------------------------------------------------------------------------- | 67 | // --------------------------------------------------------------------------- |
68 | 68 | ||
69 | async function updateWebTorrentFileACL (video: MVideo, file: MVideoFile) { | 69 | async function updateWebVideoFileACL (video: MVideo, file: MVideoFile) { |
70 | await updateObjectACL({ | 70 | await updateObjectACL({ |
71 | objectStorageKey: generateWebTorrentObjectStorageKey(file.filename), | 71 | objectStorageKey: generateWebVideoObjectStorageKey(file.filename), |
72 | bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, | 72 | bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, |
73 | isPrivate: video.hasPrivateStaticPath() | 73 | isPrivate: video.hasPrivateStaticPath() |
74 | }) | 74 | }) |
@@ -102,8 +102,8 @@ function removeHLSFileObjectStorageByFullKey (key: string) { | |||
102 | 102 | ||
103 | // --------------------------------------------------------------------------- | 103 | // --------------------------------------------------------------------------- |
104 | 104 | ||
105 | function removeWebTorrentObjectStorage (videoFile: MVideoFile) { | 105 | function removeWebVideoObjectStorage (videoFile: MVideoFile) { |
106 | return removeObject(generateWebTorrentObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS) | 106 | return removeObject(generateWebVideoObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS) |
107 | } | 107 | } |
108 | 108 | ||
109 | // --------------------------------------------------------------------------- | 109 | // --------------------------------------------------------------------------- |
@@ -122,10 +122,10 @@ async function makeHLSFileAvailable (playlist: MStreamingPlaylistVideo, filename | |||
122 | return destination | 122 | return destination |
123 | } | 123 | } |
124 | 124 | ||
125 | async function makeWebTorrentFileAvailable (filename: string, destination: string) { | 125 | async function makeWebVideoFileAvailable (filename: string, destination: string) { |
126 | const key = generateWebTorrentObjectStorageKey(filename) | 126 | const key = generateWebVideoObjectStorageKey(filename) |
127 | 127 | ||
128 | logger.info('Fetching WebTorrent file %s from object storage to %s.', key, destination, lTags()) | 128 | logger.info('Fetching Web Video file %s from object storage to %s.', key, destination, lTags()) |
129 | 129 | ||
130 | await makeAvailable({ | 130 | await makeAvailable({ |
131 | key, | 131 | key, |
@@ -138,13 +138,13 @@ async function makeWebTorrentFileAvailable (filename: string, destination: strin | |||
138 | 138 | ||
139 | // --------------------------------------------------------------------------- | 139 | // --------------------------------------------------------------------------- |
140 | 140 | ||
141 | function getWebTorrentFileReadStream (options: { | 141 | function getWebVideoFileReadStream (options: { |
142 | filename: string | 142 | filename: string |
143 | rangeHeader: string | 143 | rangeHeader: string |
144 | }) { | 144 | }) { |
145 | const { filename, rangeHeader } = options | 145 | const { filename, rangeHeader } = options |
146 | 146 | ||
147 | const key = generateWebTorrentObjectStorageKey(filename) | 147 | const key = generateWebVideoObjectStorageKey(filename) |
148 | 148 | ||
149 | return createObjectReadStream({ | 149 | return createObjectReadStream({ |
150 | key, | 150 | key, |
@@ -174,12 +174,12 @@ function getHLSFileReadStream (options: { | |||
174 | export { | 174 | export { |
175 | listHLSFileKeysOf, | 175 | listHLSFileKeysOf, |
176 | 176 | ||
177 | storeWebTorrentFile, | 177 | storeWebVideoFile, |
178 | storeHLSFileFromFilename, | 178 | storeHLSFileFromFilename, |
179 | storeHLSFileFromPath, | 179 | storeHLSFileFromPath, |
180 | storeHLSFileFromContent, | 180 | storeHLSFileFromContent, |
181 | 181 | ||
182 | updateWebTorrentFileACL, | 182 | updateWebVideoFileACL, |
183 | updateHLSFilesACL, | 183 | updateHLSFilesACL, |
184 | 184 | ||
185 | removeHLSObjectStorage, | 185 | removeHLSObjectStorage, |
@@ -187,11 +187,11 @@ export { | |||
187 | removeHLSFileObjectStorageByPath, | 187 | removeHLSFileObjectStorageByPath, |
188 | removeHLSFileObjectStorageByFullKey, | 188 | removeHLSFileObjectStorageByFullKey, |
189 | 189 | ||
190 | removeWebTorrentObjectStorage, | 190 | removeWebVideoObjectStorage, |
191 | 191 | ||
192 | makeWebTorrentFileAvailable, | 192 | makeWebVideoFileAvailable, |
193 | makeHLSFileAvailable, | 193 | makeHLSFileAvailable, |
194 | 194 | ||
195 | getWebTorrentFileReadStream, | 195 | getWebVideoFileReadStream, |
196 | getHLSFileReadStream | 196 | getHLSFileReadStream |
197 | } | 197 | } |