- inputPath: join(CONFIG.STORAGE.VIDEOS_DIR, filename),
- objectStorageKey: generateWebTorrentObjectStorageKey(filename),
- bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS
+ inputPath: path,
+ objectStorageKey: generateHLSObjectStorageKey(playlist, basename(path)),
+ bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS,
+ isPrivate: playlist.Video.hasPrivateStaticPath()
+ })
+}
+
+function storeHLSFileFromContent (playlist: MStreamingPlaylistVideo, path: string, content: string) {
+ return storeContent({
+ content,
+ inputPath: path,
+ objectStorageKey: generateHLSObjectStorageKey(playlist, basename(path)),
+ bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS,
+ isPrivate: playlist.Video.hasPrivateStaticPath()
+ })
+}
+
+// ---------------------------------------------------------------------------
+
+function storeWebTorrentFile (video: MVideo, file: MVideoFile) {
+ return storeObject({
+ inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file),
+ objectStorageKey: generateWebTorrentObjectStorageKey(file.filename),
+ bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS,
+ isPrivate: video.hasPrivateStaticPath()