+ JobQueue.Instance.createJob({
+ type: 'video-live-ending',
+ payload: {
+ videoId: fullVideo.id,
+
+ replayDirectory: live.saveReplay
+ ? await this.findReplayDirectory(fullVideo)
+ : undefined,
+
+ liveSessionId: liveSession.id,
+ streamingPlaylistId: fullVideo.getHLSPlaylist()?.id,
+
+ publishedAt: fullVideo.publishedAt.toISOString()
+ }
+ }, { delay: cleanupNow ? 0 : VIDEO_LIVE.CLEANUP_DELAY })
+
+ fullVideo.state = live.permanentLive
+ ? VideoState.WAITING_FOR_LIVE
+ : VideoState.LIVE_ENDED
+