X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fhls.ts;h=212bd095be9cb01fdd7b3fbb3c194c8fefc52cb3;hb=83903cb65d531a6b6b91715387493ba8312b264d;hp=05be403f33a1dffba37248228a3d3a8143bc0a5e;hpb=66f77f63437c6774acbd72584a9839a7636ea167;p=github%2FChocobozzz%2FPeerTube.git 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) { const streamingPlaylist = video.getHLSPlaylist() for (const file of streamingPlaylist.VideoFiles) { + const playlistFilename = VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution) + // If we did not generated a playlist for this resolution, skip - const filePlaylistPath = join(directory, VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution)) + const filePlaylistPath = join(directory, playlistFilename) if (await pathExists(filePlaylistPath) === false) continue const videoFilePath = getVideoFilePath(streamingPlaylist, file) @@ -58,7 +60,7 @@ async function updateMasterHLSPlaylist (video: MVideoWithFile) { line += `,CODECS="${codecs.filter(c => !!c).join(',')}"` masterPlaylists.push(line) - masterPlaylists.push(VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution)) + masterPlaylists.push(playlistFilename) } await writeFile(masterPlaylistPath, masterPlaylists.join('\n') + '\n')