]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/live/shared/muxing-session.ts
Force stop remote live transcoding
[github/Chocobozzz/PeerTube.git] / server / lib / live / shared / muxing-session.ts
index c9e5df906f9e11d8a5a389255844533075689440..c672ec4d6c28db87bfe39f3cbd2a15422f1abcc4 100644 (file)
@@ -184,15 +184,11 @@ class MuxingSession extends EventEmitter {
   }
 
   private watchMasterFile () {
-    const watcher = this.filesWatcher.on('change', async path => {
+    this.filesWatcher.on('add', async path => {
       if (path !== join(this.outDirectory, this.streamingPlaylist.playlistFilename)) return
       if (this.masterPlaylistCreated === true) return
 
       try {
-        const masterPlaylistContent = await readFile(path, 'utf8')
-        // Not generated yet
-        if (!masterPlaylistContent) return
-
         if (this.streamingPlaylist.storage === VideoStorage.OBJECT_STORAGE) {
           const url = await storeHLSFileFromFilename(this.streamingPlaylist, this.streamingPlaylist.playlistFilename)
 
@@ -209,9 +205,6 @@ class MuxingSession extends EventEmitter {
       this.masterPlaylistCreated = true
 
       logger.info('Master playlist file for %s has been created', this.videoUUID, this.lTags())
-
-      watcher.close()
-        .catch(err => logger.error('Cannot close watcher', { err }))
     })
   }
 
@@ -484,6 +477,7 @@ class MuxingSession extends EventEmitter {
 
       lTags: this.lTags,
 
+      sessionId: this.sessionId,
       inputLocalUrl: this.inputLocalUrl,
       inputPublicUrl: this.inputPublicUrl,