aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-live-ending.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-23 10:29:43 +0200
committerChocobozzz <me@florianbigard.com>2022-06-23 10:30:48 +0200
commit53023be33af420675d0060eb95c99a8038457564 (patch)
tree699a13694b0c1c8589d10de95184708a451fcab4 /server/lib/job-queue/handlers/video-live-ending.ts
parent50341c8fe988ca2a3d7c700f9aa918673dc979c2 (diff)
downloadPeerTube-53023be33af420675d0060eb95c99a8038457564.tar.gz
PeerTube-53023be33af420675d0060eb95c99a8038457564.tar.zst
PeerTube-53023be33af420675d0060eb95c99a8038457564.zip
Fix fast restream in saved permanent live
Diffstat (limited to 'server/lib/job-queue/handlers/video-live-ending.ts')
-rw-r--r--server/lib/job-queue/handlers/video-live-ending.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index feec257fc..450bda2fd 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -4,7 +4,7 @@ import { join } from 'path'
4import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamDuration } from '@server/helpers/ffmpeg' 4import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamDuration } from '@server/helpers/ffmpeg'
5import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' 5import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
6import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' 6import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
7import { cleanupNormalLive, cleanupPermanentLive, cleanupTMPLiveFiles, LiveSegmentShaStore } from '@server/lib/live' 7import { cleanupUnsavedNormalLive, cleanupPermanentLive, cleanupTMPLiveFiles, LiveSegmentShaStore } from '@server/lib/live'
8import { 8import {
9 generateHLSMasterPlaylistFilename, 9 generateHLSMasterPlaylistFilename,
10 generateHlsSha256SegmentsFilename, 10 generateHlsSha256SegmentsFilename,
@@ -22,15 +22,17 @@ import { VideoLiveSessionModel } from '@server/models/video/video-live-session'
22import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 22import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
23import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@server/types/models' 23import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@server/types/models'
24import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' 24import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models'
25import { logger } from '../../../helpers/logger' 25import { logger, loggerTagsFactory } from '../../../helpers/logger'
26
27const lTags = loggerTagsFactory('live', 'job')
26 28
27async function processVideoLiveEnding (job: Job) { 29async function processVideoLiveEnding (job: Job) {
28 const payload = job.data as VideoLiveEndingPayload 30 const payload = job.data as VideoLiveEndingPayload
29 31
30 logger.info('Processing video live ending for %s.', payload.videoId, { payload }) 32 logger.info('Processing video live ending for %s.', payload.videoId, { payload, ...lTags() })
31 33
32 function logError () { 34 function logError () {
33 logger.warn('Video live %d does not exist anymore. Cannot process live ending.', payload.videoId) 35 logger.warn('Video live %d does not exist anymore. Cannot process live ending.', payload.videoId, lTags())
34 } 36 }
35 37
36 const liveVideo = await VideoModel.load(payload.videoId) 38 const liveVideo = await VideoModel.load(payload.videoId)
@@ -73,8 +75,6 @@ async function saveReplayToExternalVideo (options: {
73}) { 75}) {
74 const { liveVideo, liveSession, publishedAt, replayDirectory } = options 76 const { liveVideo, liveSession, publishedAt, replayDirectory } = options
75 77
76 await cleanupTMPLiveFiles(getLiveDirectory(liveVideo))
77
78 const video = new VideoModel({ 78 const video = new VideoModel({
79 name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`, 79 name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`,
80 isLive: false, 80 isLive: false,
@@ -243,7 +243,7 @@ async function cleanupLiveAndFederate (options: {
243 if (live.permanentLive) { 243 if (live.permanentLive) {
244 await cleanupPermanentLive(video, streamingPlaylist) 244 await cleanupPermanentLive(video, streamingPlaylist)
245 } else { 245 } else {
246 await cleanupNormalLive(video, streamingPlaylist) 246 await cleanupUnsavedNormalLive(video, streamingPlaylist)
247 } 247 }
248 } 248 }
249 249