+ return VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(videoOrPlaylist), videoPath => {
+ return createTorrentAndSetInfoHashFromPath(videoOrPlaylist, videoFile, videoPath)
+ })
+}
+
+async function createTorrentAndSetInfoHashFromPath (
+ videoOrPlaylist: MVideo | MStreamingPlaylistVideo,
+ videoFile: MVideoFile,
+ filePath: string
+) {