+// ---------------------------------------------------------------------------
+
+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()
+ })
+}
+
+// ---------------------------------------------------------------------------
+
+async function updateWebTorrentFileACL (video: MVideo, file: MVideoFile) {
+ await updateObjectACL({
+ objectStorageKey: generateWebTorrentObjectStorageKey(file.filename),
+ bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS,
+ isPrivate: video.hasPrivateStaticPath()
+ })
+}
+
+async function updateHLSFilesACL (playlist: MStreamingPlaylistVideo) {
+ await updatePrefixACL({
+ prefix: generateHLSObjectBaseStorageKey(playlist),
+ bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS,
+ isPrivate: playlist.Video.hasPrivateStaticPath()
+ })
+}
+
+// ---------------------------------------------------------------------------
+
+function removeHLSObjectStorage (playlist: MStreamingPlaylistVideo) {
+ return removePrefix(generateHLSObjectBaseStorageKey(playlist), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
+}
+
+function removeHLSFileObjectStorageByFilename (playlist: MStreamingPlaylistVideo, filename: string) {
+ return removeObject(generateHLSObjectStorageKey(playlist, filename), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
+}
+
+function removeHLSFileObjectStorageByPath (playlist: MStreamingPlaylistVideo, path: string) {
+ return removeObject(generateHLSObjectStorageKey(playlist, basename(path)), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)