diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-18 14:35:08 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-18 15:20:57 +0100 |
commit | ad5db1044c8599eaaaa2a578b350777ae996b068 (patch) | |
tree | 3e003cccf021152405d49b21c6c91b703c8ae96c /server/lib/object-storage/videos.ts | |
parent | b46cf4b920984492df598c1b61179acfc7f6f22e (diff) | |
download | PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.gz PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.zst PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.zip |
Add ability to run transcoding jobs
Diffstat (limited to 'server/lib/object-storage/videos.ts')
-rw-r--r-- | server/lib/object-storage/videos.ts | 16 |
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 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { logger } from '@server/helpers/logger' | 2 | import { logger } from '@server/helpers/logger' |
3 | import { CONFIG } from '@server/initializers/config' | 3 | import { CONFIG } from '@server/initializers/config' |
4 | import { MStreamingPlaylist, MVideoFile, MVideoUUID } from '@server/types/models' | 4 | import { MStreamingPlaylistVideo, MVideoFile } from '@server/types/models' |
5 | import { getHLSDirectory } from '../paths' | 5 | import { getHLSDirectory } from '../paths' |
6 | import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' | 6 | import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' |
7 | import { lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared' | 7 | import { lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared' |
8 | 8 | ||
9 | function storeHLSFile (playlist: MStreamingPlaylist, video: MVideoUUID, filename: string) { | 9 | function 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 | ||
27 | function removeHLSObjectStorage (playlist: MStreamingPlaylist, video: MVideoUUID) { | 27 | function 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 | ||
31 | function removeWebTorrentObjectStorage (videoFile: MVideoFile) { | 31 | function 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 | ||
35 | async function makeHLSFileAvailable (playlist: MStreamingPlaylist, video: MVideoUUID, filename: string, destination: string) { | 35 | async 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 | ||