diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-22 14:28:03 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-07-26 11:29:31 +0200 |
commit | 83903cb65d531a6b6b91715387493ba8312b264d (patch) | |
tree | fd172e26a483331e74f15a062743a9d40d4016d3 /server/lib/hls.ts | |
parent | c4fa01f7c45b66b112ebd08abce744b7c4041feb (diff) | |
download | PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.gz PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.zst PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.zip |
Generate random uuid for video files
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r-- | server/lib/hls.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 05be403f3..212bd095b 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts | |||
@@ -36,8 +36,10 @@ async function updateMasterHLSPlaylist (video: MVideoWithFile) { | |||
36 | const streamingPlaylist = video.getHLSPlaylist() | 36 | const streamingPlaylist = video.getHLSPlaylist() |
37 | 37 | ||
38 | for (const file of streamingPlaylist.VideoFiles) { | 38 | for (const file of streamingPlaylist.VideoFiles) { |
39 | const playlistFilename = VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution) | ||
40 | |||
39 | // If we did not generated a playlist for this resolution, skip | 41 | // If we did not generated a playlist for this resolution, skip |
40 | const filePlaylistPath = join(directory, VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution)) | 42 | const filePlaylistPath = join(directory, playlistFilename) |
41 | if (await pathExists(filePlaylistPath) === false) continue | 43 | if (await pathExists(filePlaylistPath) === false) continue |
42 | 44 | ||
43 | const videoFilePath = getVideoFilePath(streamingPlaylist, file) | 45 | const videoFilePath = getVideoFilePath(streamingPlaylist, file) |
@@ -58,7 +60,7 @@ async function updateMasterHLSPlaylist (video: MVideoWithFile) { | |||
58 | line += `,CODECS="${codecs.filter(c => !!c).join(',')}"` | 60 | line += `,CODECS="${codecs.filter(c => !!c).join(',')}"` |
59 | 61 | ||
60 | masterPlaylists.push(line) | 62 | masterPlaylists.push(line) |
61 | masterPlaylists.push(VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution)) | 63 | masterPlaylists.push(playlistFilename) |
62 | } | 64 | } |
63 | 65 | ||
64 | await writeFile(masterPlaylistPath, masterPlaylists.join('\n') + '\n') | 66 | await writeFile(masterPlaylistPath, masterPlaylists.join('\n') + '\n') |