mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Fix fast restream in saved permanent live
This commit is contained in:
parent
50341c8fe9
commit
53023be33a
9 changed files with 182 additions and 65 deletions
|
@ -10,20 +10,20 @@ function buildConcatenatedName (segmentOrPlaylistPath: string) {
|
|||
return 'concat-' + num[1] + '.ts'
|
||||
}
|
||||
|
||||
async function cleanupPermanentLive (video: MVideo, streamingPlaylist?: MStreamingPlaylist) {
|
||||
async function cleanupPermanentLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) {
|
||||
const hlsDirectory = getLiveDirectory(video)
|
||||
|
||||
await cleanupTMPLiveFiles(hlsDirectory)
|
||||
|
||||
if (streamingPlaylist) await streamingPlaylist.destroy()
|
||||
await streamingPlaylist.destroy()
|
||||
}
|
||||
|
||||
async function cleanupNormalLive (video: MVideo, streamingPlaylist?: MStreamingPlaylist) {
|
||||
async function cleanupUnsavedNormalLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) {
|
||||
const hlsDirectory = getLiveDirectory(video)
|
||||
|
||||
await remove(hlsDirectory)
|
||||
|
||||
if (streamingPlaylist) await streamingPlaylist.destroy()
|
||||
await streamingPlaylist.destroy()
|
||||
}
|
||||
|
||||
async function cleanupTMPLiveFiles (hlsDirectory: string) {
|
||||
|
@ -49,7 +49,7 @@ async function cleanupTMPLiveFiles (hlsDirectory: string) {
|
|||
|
||||
export {
|
||||
cleanupPermanentLive,
|
||||
cleanupNormalLive,
|
||||
cleanupUnsavedNormalLive,
|
||||
cleanupTMPLiveFiles,
|
||||
buildConcatenatedName
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue