import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models'
import { logger, loggerTagsFactory } from '../../../helpers/logger'
import { VideoPathManager } from '@server/lib/video-path-manager'
+import { VideoLiveReplaySettingModel } from '@server/models/video/video-live-replay-setting'
const lTags = loggerTagsFactory('live', 'job')
return cleanupLiveAndFederate({ permanentLive, video, streamingPlaylistId: payload.streamingPlaylistId })
}
- return replaceLiveByReplay({ video, liveSession, live, permanentLive, replayDirectory: payload.replayDirectory })
+ return replaceLiveByReplay({
+ video,
+ liveSession,
+ live,
+ permanentLive,
+ replayDirectory: payload.replayDirectory
+ })
}
// ---------------------------------------------------------------------------
}) {
const { liveVideo, liveSession, publishedAt, replayDirectory } = options
+ const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId)
+
const replayVideo = new VideoModel({
name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`,
isLive: false,
nsfw: liveVideo.nsfw,
description: liveVideo.description,
support: liveVideo.support,
- privacy: liveVideo.privacy,
+ privacy: replaySettings.privacy,
channelId: liveVideo.channelId
}) as MVideoWithAllFiles
}) {
const { video, liveSession, live, permanentLive, replayDirectory } = options
+ const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId)
const videoWithFiles = await VideoModel.loadFull(video.id)
const hlsPlaylist = videoWithFiles.getHLSPlaylist()
await live.destroy()
videoWithFiles.isLive = false
+ videoWithFiles.privacy = replaySettings.privacy
videoWithFiles.waitTranscoding = true
videoWithFiles.state = VideoState.TO_TRANSCODE