]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/object-storage/videos.ts
Translated using Weblate (Persian)
[github/Chocobozzz/PeerTube.git] / server / lib / object-storage / videos.ts
index bfdef94fd9dd71670200f607e899c84df6e8fbc2..9152c535295eb3108bb3a95d4e3eb65c81272d05 100644 (file)
@@ -13,6 +13,7 @@ import {
   removeObject,
   removeObjectByFullKey,
   removePrefix,
+  storeContent,
   storeObject,
   updateObjectACL,
   updatePrefixACL
@@ -42,6 +43,16 @@ function storeHLSFileFromPath (playlist: MStreamingPlaylistVideo, path: string)
   })
 }
 
+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) {
@@ -166,6 +177,7 @@ export {
   storeWebTorrentFile,
   storeHLSFileFromFilename,
   storeHLSFileFromPath,
+  storeHLSFileFromContent,
 
   updateWebTorrentFileACL,
   updateHLSFilesACL,