-async function saveLive (video: MVideo, live: MVideoLive) {
- const hlsDirectory = getHLSDirectory(video, false)
- const replayDirectory = join(hlsDirectory, VIDEO_LIVE.REPLAY_DIRECTORY)
-
- const rootFiles = await readdir(hlsDirectory)
-
- const playlistFiles: string[] = []
-
- for (const file of rootFiles) {
- if (file.endsWith('.m3u8') !== true) continue
-
- await move(join(hlsDirectory, file), join(replayDirectory, file))
-
- if (file !== 'master.m3u8') {
- playlistFiles.push(file)
- }
- }
-
- const replayFiles = await readdir(replayDirectory)
-
- const resolutions: number[] = []
- let duration: number
-
- for (const playlistFile of playlistFiles) {
- const playlistPath = join(replayDirectory, playlistFile)
- const { videoFileResolution } = await getVideoFileResolution(playlistPath)
+async function saveLive (video: MVideo, live: MVideoLive, streamingPlaylist: MStreamingPlaylist) {
+ const replayDirectory = VideoPathManager.Instance.getFSHLSOutputPath(video, VIDEO_LIVE.REPLAY_DIRECTORY)