aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/object-storage/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/object-storage/videos.ts')
-rw-r--r--server/lib/object-storage/videos.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.ts
index 15b8f58d5..8988f3e2a 100644
--- a/server/lib/object-storage/videos.ts
+++ b/server/lib/object-storage/videos.ts
@@ -1,17 +1,17 @@
1import { join } from 'path' 1import { join } from 'path'
2import { logger } from '@server/helpers/logger' 2import { logger } from '@server/helpers/logger'
3import { CONFIG } from '@server/initializers/config' 3import { CONFIG } from '@server/initializers/config'
4import { MStreamingPlaylist, MVideoFile, MVideoUUID } from '@server/types/models' 4import { MStreamingPlaylistVideo, MVideoFile } from '@server/types/models'
5import { getHLSDirectory } from '../paths' 5import { getHLSDirectory } from '../paths'
6import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' 6import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys'
7import { lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared' 7import { lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared'
8 8
9function storeHLSFile (playlist: MStreamingPlaylist, video: MVideoUUID, filename: string) { 9function storeHLSFile (playlist: MStreamingPlaylistVideo, filename: string) {
10 const baseHlsDirectory = getHLSDirectory(video) 10 const baseHlsDirectory = getHLSDirectory(playlist.Video)
11 11
12 return storeObject({ 12 return storeObject({
13 inputPath: join(baseHlsDirectory, filename), 13 inputPath: join(baseHlsDirectory, filename),
14 objectStorageKey: generateHLSObjectStorageKey(playlist, video, filename), 14 objectStorageKey: generateHLSObjectStorageKey(playlist, filename),
15 bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS 15 bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS
16 }) 16 })
17} 17}
@@ -24,16 +24,16 @@ function storeWebTorrentFile (filename: string) {
24 }) 24 })
25} 25}
26 26
27function removeHLSObjectStorage (playlist: MStreamingPlaylist, video: MVideoUUID) { 27function removeHLSObjectStorage (playlist: MStreamingPlaylistVideo) {
28 return removePrefix(generateHLSObjectBaseStorageKey(playlist, video), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) 28 return removePrefix(generateHLSObjectBaseStorageKey(playlist), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
29} 29}
30 30
31function removeWebTorrentObjectStorage (videoFile: MVideoFile) { 31function removeWebTorrentObjectStorage (videoFile: MVideoFile) {
32 return removeObject(generateWebTorrentObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS) 32 return removeObject(generateWebTorrentObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS)
33} 33}
34 34
35async function makeHLSFileAvailable (playlist: MStreamingPlaylist, video: MVideoUUID, filename: string, destination: string) { 35async function makeHLSFileAvailable (playlist: MStreamingPlaylistVideo, filename: string, destination: string) {
36 const key = generateHLSObjectStorageKey(playlist, video, filename) 36 const key = generateHLSObjectStorageKey(playlist, filename)
37 37
38 logger.info('Fetching HLS file %s from object storage to %s.', key, destination, lTags()) 38 logger.info('Fetching HLS file %s from object storage to %s.', key, destination, lTags())
39 39