From 83903cb65d531a6b6b91715387493ba8312b264d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Jul 2021 14:28:03 +0200 Subject: Generate random uuid for video files --- server/lib/transcoding/video-transcoding.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/lib/transcoding/video-transcoding.ts') diff --git a/server/lib/transcoding/video-transcoding.ts b/server/lib/transcoding/video-transcoding.ts index 1ad63baf3..d70f7f474 100644 --- a/server/lib/transcoding/video-transcoding.ts +++ b/server/lib/transcoding/video-transcoding.ts @@ -14,7 +14,7 @@ import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSER import { VideoFileModel } from '../../models/video/video-file' import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' import { updateMasterHLSPlaylist, updateSha256VODSegments } from '../hls' -import { generateVideoFilename, generateVideoStreamingPlaylistName, getVideoFilePath } from '../video-paths' +import { generateHLSVideoFilename, generateWebTorrentVideoFilename, getVideoFilePath } from '../video-paths' import { VideoTranscodingProfilesManager } from './video-transcoding-profiles' /** @@ -60,7 +60,7 @@ async function optimizeOriginalVideofile (video: MVideoFullLight, inputVideoFile // Important to do this before getVideoFilename() to take in account the new filename inputVideoFile.extname = newExtname - inputVideoFile.filename = generateVideoFilename(video, false, resolution, newExtname) + inputVideoFile.filename = generateWebTorrentVideoFilename(resolution, newExtname) const videoOutputPath = getVideoFilePath(video, inputVideoFile) @@ -86,7 +86,7 @@ async function transcodeNewWebTorrentResolution (video: MVideoFullLight, resolut const newVideoFile = new VideoFileModel({ resolution, extname, - filename: generateVideoFilename(video, false, resolution, extname), + filename: generateWebTorrentVideoFilename(resolution, extname), size: 0, videoId: video.id }) @@ -169,7 +169,7 @@ async function mergeAudioVideofile (video: MVideoFullLight, resolution: VideoRes // Important to do this before getVideoFilename() to take in account the new file extension inputVideoFile.extname = newExtname - inputVideoFile.filename = generateVideoFilename(video, false, inputVideoFile.resolution, newExtname) + inputVideoFile.filename = generateWebTorrentVideoFilename(inputVideoFile.resolution, newExtname) const videoOutputPath = getVideoFilePath(video, inputVideoFile) // ffmpeg generated a new video file, so update the video duration @@ -271,7 +271,7 @@ async function generateHlsPlaylistCommon (options: { const videoTranscodedBasePath = join(transcodeDirectory, type) await ensureDir(videoTranscodedBasePath) - const videoFilename = generateVideoStreamingPlaylistName(video.uuid, resolution) + const videoFilename = generateHLSVideoFilename(resolution) const playlistFilename = VideoStreamingPlaylistModel.getHlsPlaylistFilename(resolution) const playlistFileTranscodePath = join(videoTranscodedBasePath, playlistFilename) @@ -319,7 +319,7 @@ async function generateHlsPlaylistCommon (options: { resolution, extname, size: 0, - filename: generateVideoFilename(video, true, resolution, extname), + filename: videoFilename, fps: -1, videoStreamingPlaylistId: videoStreamingPlaylist.id }) -- cgit v1.2.3