diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-29 08:57:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-29 09:08:13 +0200 |
commit | ae22c59f14d0d553f60b281948b6c232c2aca178 (patch) | |
tree | 4d3b38ebcf7ff27966233b381e980a34112e943e /server/lib/job-queue | |
parent | ba278fa51dc578835c7fcb3a6eca4cd8cd86c755 (diff) | |
download | PeerTube-ae22c59f14d0d553f60b281948b6c232c2aca178.tar.gz PeerTube-ae22c59f14d0d553f60b281948b6c232c2aca178.tar.zst PeerTube-ae22c59f14d0d553f60b281948b6c232c2aca178.zip |
Fix broken replay with long live video name
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/video-live-ending.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 814f313a3..49feb53f2 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts | |||
@@ -20,6 +20,8 @@ import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@serv | |||
20 | import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@shared/ffmpeg' | 20 | import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@shared/ffmpeg' |
21 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' | 21 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' |
22 | import { logger, loggerTagsFactory } from '../../../helpers/logger' | 22 | import { logger, loggerTagsFactory } from '../../../helpers/logger' |
23 | import { peertubeTruncate } from '@server/helpers/core-utils' | ||
24 | import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' | ||
23 | 25 | ||
24 | const lTags = loggerTagsFactory('live', 'job') | 26 | const lTags = loggerTagsFactory('live', 'job') |
25 | 27 | ||
@@ -88,8 +90,13 @@ async function saveReplayToExternalVideo (options: { | |||
88 | 90 | ||
89 | const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId) | 91 | const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId) |
90 | 92 | ||
93 | const videoNameSuffix = ` - ${new Date(publishedAt).toLocaleString()}` | ||
94 | const truncatedVideoName = peertubeTruncate(liveVideo.name, { | ||
95 | length: CONSTRAINTS_FIELDS.VIDEOS.NAME.max - videoNameSuffix.length | ||
96 | }) | ||
97 | |||
91 | const replayVideo = new VideoModel({ | 98 | const replayVideo = new VideoModel({ |
92 | name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`, | 99 | name: truncatedVideoName + videoNameSuffix, |
93 | isLive: false, | 100 | isLive: false, |
94 | state: VideoState.TO_TRANSCODE, | 101 | state: VideoState.TO_TRANSCODE, |
95 | duration: 0, | 102 | duration: 0, |