From 53023be33af420675d0060eb95c99a8038457564 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Jun 2022 10:29:43 +0200 Subject: Fix fast restream in saved permanent live --- server/lib/job-queue/handlers/video-live-ending.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'server/lib/job-queue/handlers') 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' import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamDuration } from '@server/helpers/ffmpeg' import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' -import { cleanupNormalLive, cleanupPermanentLive, cleanupTMPLiveFiles, LiveSegmentShaStore } from '@server/lib/live' +import { cleanupUnsavedNormalLive, cleanupPermanentLive, cleanupTMPLiveFiles, LiveSegmentShaStore } from '@server/lib/live' import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, @@ -22,15 +22,17 @@ import { VideoLiveSessionModel } from '@server/models/video/video-live-session' import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@server/types/models' import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' -import { logger } from '../../../helpers/logger' +import { logger, loggerTagsFactory } from '../../../helpers/logger' + +const lTags = loggerTagsFactory('live', 'job') async function processVideoLiveEnding (job: Job) { const payload = job.data as VideoLiveEndingPayload - logger.info('Processing video live ending for %s.', payload.videoId, { payload }) + logger.info('Processing video live ending for %s.', payload.videoId, { payload, ...lTags() }) function logError () { - logger.warn('Video live %d does not exist anymore. Cannot process live ending.', payload.videoId) + logger.warn('Video live %d does not exist anymore. Cannot process live ending.', payload.videoId, lTags()) } const liveVideo = await VideoModel.load(payload.videoId) @@ -73,8 +75,6 @@ async function saveReplayToExternalVideo (options: { }) { const { liveVideo, liveSession, publishedAt, replayDirectory } = options - await cleanupTMPLiveFiles(getLiveDirectory(liveVideo)) - const video = new VideoModel({ name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`, isLive: false, @@ -243,7 +243,7 @@ async function cleanupLiveAndFederate (options: { if (live.permanentLive) { await cleanupPermanentLive(video, streamingPlaylist) } else { - await cleanupNormalLive(video, streamingPlaylist) + await cleanupUnsavedNormalLive(video, streamingPlaylist) } } -- cgit v1.2.3