diff options
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/video-live-ending.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index c6263f55a..2f3a971bd 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts | |||
@@ -19,6 +19,7 @@ import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@serv | |||
19 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' | 19 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' |
20 | import { logger, loggerTagsFactory } from '../../../helpers/logger' | 20 | import { logger, loggerTagsFactory } from '../../../helpers/logger' |
21 | import { VideoPathManager } from '@server/lib/video-path-manager' | 21 | import { VideoPathManager } from '@server/lib/video-path-manager' |
22 | import { VideoLiveReplaySettingModel } from '@server/models/video/video-live-replay-setting' | ||
22 | 23 | ||
23 | const lTags = loggerTagsFactory('live', 'job') | 24 | const lTags = loggerTagsFactory('live', 'job') |
24 | 25 | ||
@@ -60,7 +61,13 @@ async function processVideoLiveEnding (job: Job) { | |||
60 | return cleanupLiveAndFederate({ permanentLive, video, streamingPlaylistId: payload.streamingPlaylistId }) | 61 | return cleanupLiveAndFederate({ permanentLive, video, streamingPlaylistId: payload.streamingPlaylistId }) |
61 | } | 62 | } |
62 | 63 | ||
63 | return replaceLiveByReplay({ video, liveSession, live, permanentLive, replayDirectory: payload.replayDirectory }) | 64 | return replaceLiveByReplay({ |
65 | video, | ||
66 | liveSession, | ||
67 | live, | ||
68 | permanentLive, | ||
69 | replayDirectory: payload.replayDirectory | ||
70 | }) | ||
64 | } | 71 | } |
65 | 72 | ||
66 | // --------------------------------------------------------------------------- | 73 | // --------------------------------------------------------------------------- |
@@ -79,6 +86,8 @@ async function saveReplayToExternalVideo (options: { | |||
79 | }) { | 86 | }) { |
80 | const { liveVideo, liveSession, publishedAt, replayDirectory } = options | 87 | const { liveVideo, liveSession, publishedAt, replayDirectory } = options |
81 | 88 | ||
89 | const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId) | ||
90 | |||
82 | const replayVideo = new VideoModel({ | 91 | const replayVideo = new VideoModel({ |
83 | name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`, | 92 | name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`, |
84 | isLive: false, | 93 | isLive: false, |
@@ -95,7 +104,7 @@ async function saveReplayToExternalVideo (options: { | |||
95 | nsfw: liveVideo.nsfw, | 104 | nsfw: liveVideo.nsfw, |
96 | description: liveVideo.description, | 105 | description: liveVideo.description, |
97 | support: liveVideo.support, | 106 | support: liveVideo.support, |
98 | privacy: liveVideo.privacy, | 107 | privacy: replaySettings.privacy, |
99 | channelId: liveVideo.channelId | 108 | channelId: liveVideo.channelId |
100 | }) as MVideoWithAllFiles | 109 | }) as MVideoWithAllFiles |
101 | 110 | ||
@@ -142,6 +151,7 @@ async function replaceLiveByReplay (options: { | |||
142 | }) { | 151 | }) { |
143 | const { video, liveSession, live, permanentLive, replayDirectory } = options | 152 | const { video, liveSession, live, permanentLive, replayDirectory } = options |
144 | 153 | ||
154 | const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId) | ||
145 | const videoWithFiles = await VideoModel.loadFull(video.id) | 155 | const videoWithFiles = await VideoModel.loadFull(video.id) |
146 | const hlsPlaylist = videoWithFiles.getHLSPlaylist() | 156 | const hlsPlaylist = videoWithFiles.getHLSPlaylist() |
147 | 157 | ||
@@ -150,6 +160,7 @@ async function replaceLiveByReplay (options: { | |||
150 | await live.destroy() | 160 | await live.destroy() |
151 | 161 | ||
152 | videoWithFiles.isLive = false | 162 | videoWithFiles.isLive = false |
163 | videoWithFiles.privacy = replaySettings.privacy | ||
153 | videoWithFiles.waitTranscoding = true | 164 | videoWithFiles.waitTranscoding = true |
154 | videoWithFiles.state = VideoState.TO_TRANSCODE | 165 | videoWithFiles.state = VideoState.TO_TRANSCODE |
155 | 166 | ||