X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fjob-queue%2Fhandlers%2Fvideo-live-ending.ts;h=49feb53f294383f86f1ddb5e3f87501b0531a070;hb=ae22c59f14d0d553f60b281948b6c232c2aca178;hp=814f313a3bb8d946905bbbce3fb1ffba571e0d28;hpb=ba278fa51dc578835c7fcb3a6eca4cd8cd86c755;p=github%2FChocobozzz%2FPeerTube.git 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 import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@shared/ffmpeg' import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' import { logger, loggerTagsFactory } from '../../../helpers/logger' +import { peertubeTruncate } from '@server/helpers/core-utils' +import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' const lTags = loggerTagsFactory('live', 'job') @@ -88,8 +90,13 @@ async function saveReplayToExternalVideo (options: { const replaySettings = await VideoLiveReplaySettingModel.load(liveSession.replaySettingId) + const videoNameSuffix = ` - ${new Date(publishedAt).toLocaleString()}` + const truncatedVideoName = peertubeTruncate(liveVideo.name, { + length: CONSTRAINTS_FIELDS.VIDEOS.NAME.max - videoNameSuffix.length + }) + const replayVideo = new VideoModel({ - name: `${liveVideo.name} - ${new Date(publishedAt).toLocaleString()}`, + name: truncatedVideoName + videoNameSuffix, isLive: false, state: VideoState.TO_TRANSCODE, duration: 0,