aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/hls.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r--server/lib/hls.ts22
1 files changed, 13 insertions, 9 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts
index ad29e4c90..9ec931b4f 100644
--- a/server/lib/hls.ts
+++ b/server/lib/hls.ts
@@ -35,15 +35,19 @@ async function updateStreamingPlaylistsInfohashesIfNeeded () {
35} 35}
36 36
37async function updatePlaylistAfterFileChange (video: MVideo, playlist: MStreamingPlaylist) { 37async function updatePlaylistAfterFileChange (video: MVideo, playlist: MStreamingPlaylist) {
38 let playlistWithFiles = await updateMasterHLSPlaylist(video, playlist) 38 try {
39 playlistWithFiles = await updateSha256VODSegments(video, playlist) 39 let playlistWithFiles = await updateMasterHLSPlaylist(video, playlist)
40 40 playlistWithFiles = await updateSha256VODSegments(video, playlist)
41 // Refresh playlist, operations can take some time 41
42 playlistWithFiles = await VideoStreamingPlaylistModel.loadWithVideoAndFiles(playlist.id) 42 // Refresh playlist, operations can take some time
43 playlistWithFiles.assignP2PMediaLoaderInfoHashes(video, playlistWithFiles.VideoFiles) 43 playlistWithFiles = await VideoStreamingPlaylistModel.loadWithVideoAndFiles(playlist.id)
44 await playlistWithFiles.save() 44 playlistWithFiles.assignP2PMediaLoaderInfoHashes(video, playlistWithFiles.VideoFiles)
45 45 await playlistWithFiles.save()
46 video.setHLSPlaylist(playlistWithFiles) 46
47 video.setHLSPlaylist(playlistWithFiles)
48 } catch (err) {
49 logger.info('Cannot update playlist after file change. Maybe due to concurrent transcoding', { err })
50 }
47} 51}
48 52
49// --------------------------------------------------------------------------- 53// ---------------------------------------------------------------------------