diff options
Diffstat (limited to 'server/lib/object-storage')
-rw-r--r-- | server/lib/object-storage/videos.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.ts index 62aae248b..e323baaa2 100644 --- a/server/lib/object-storage/videos.ts +++ b/server/lib/object-storage/videos.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import { basename, join } from 'path' | 1 | import { basename, 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 { MStreamingPlaylistVideo, 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 { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' | 7 | import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' |
7 | import { listKeysOfPrefix, lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared' | 8 | import { listKeysOfPrefix, lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared' |
8 | 9 | ||
@@ -30,10 +31,10 @@ function storeHLSFileFromPath (playlist: MStreamingPlaylistVideo, path: string) | |||
30 | 31 | ||
31 | // --------------------------------------------------------------------------- | 32 | // --------------------------------------------------------------------------- |
32 | 33 | ||
33 | function storeWebTorrentFile (filename: string) { | 34 | function storeWebTorrentFile (video: MVideo, file: MVideoFile) { |
34 | return storeObject({ | 35 | return storeObject({ |
35 | inputPath: join(CONFIG.STORAGE.VIDEOS_DIR, filename), | 36 | inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file), |
36 | objectStorageKey: generateWebTorrentObjectStorageKey(filename), | 37 | objectStorageKey: generateWebTorrentObjectStorageKey(file.filename), |
37 | bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS | 38 | bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS |
38 | }) | 39 | }) |
39 | } | 40 | } |