+
+ const videoFilePath = getVideoFilePath(videoStreamingPlaylist, newVideoFile)
+ const stats = await stat(videoFilePath)
+
+ newVideoFile.size = stats.size
+ newVideoFile.fps = await getVideoFileFPS(videoFilePath)
+ newVideoFile.metadata = await getMetadataFromFile(videoFilePath)
+
+ await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile)
+
+ await VideoFileModel.customUpsert(newVideoFile, 'streaming-playlist', undefined)
+ videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles')
+
+ videoStreamingPlaylist.p2pMediaLoaderInfohashes = VideoStreamingPlaylistModel.buildP2PMediaLoaderInfoHashes(
+ playlistUrl, videoStreamingPlaylist.VideoFiles
+ )
+ await videoStreamingPlaylist.save()
+
+ video.setHLSPlaylist(videoStreamingPlaylist)
+
+ await updateMasterHLSPlaylist(video)
+ await updateSha256VODSegments(video)
+
+ return video