X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Flive%2Flive-manager.ts;h=5c6e69806b77532d8ee05751b8d72d065b4a4f80;hb=3f0ceab06e5320f62f593c49daa30d963dbc36f9;hp=68aa184431e3c96e21b8d986cad26321d935f00e;hpb=287057050526e1f474c4f4d5d9a7ef3b7c677f2f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index 68aa18443..5c6e69806 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts @@ -178,6 +178,10 @@ class LiveManager { return !!this.rtmpServer } + hasSession (sessionId: string) { + return this.getContext().sessions.has(sessionId) + } + stopSessionOf (videoUUID: string, error: LiveVideoError | null) { const sessionId = this.videoSessions.get(videoUUID) if (!sessionId) { @@ -309,7 +313,7 @@ class LiveManager { const liveSession = await this.saveStartingSession(videoLive) const user = await UserModel.loadByLiveId(videoLive.id) - LiveQuotaStore.Instance.addNewLive(user.id, videoLive.id) + LiveQuotaStore.Instance.addNewLive(user.id, sessionId) const muxingSession = new MuxingSession({ context: this.getContext(), @@ -355,7 +359,7 @@ class LiveManager { muxingSession.on('after-cleanup', ({ videoUUID }) => { this.muxingSessions.delete(sessionId) - LiveQuotaStore.Instance.removeLive(user.id, videoLive.id) + LiveQuotaStore.Instance.removeLive(user.id, sessionId) muxingSession.destroy()