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/job-queue/handlers/video-file-import.ts | 4 ++-- server/lib/job-queue/handlers/video-import.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/job-queue') diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts index 187cb652e..1783f206a 100644 --- a/server/lib/job-queue/handlers/video-file-import.ts +++ b/server/lib/job-queue/handlers/video-file-import.ts @@ -2,7 +2,7 @@ import * as Bull from 'bull' import { copy, stat } from 'fs-extra' import { getLowercaseExtension } from '@server/helpers/core-utils' import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' -import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' +import { generateWebTorrentVideoFilename, getVideoFilePath } from '@server/lib/video-paths' import { UserModel } from '@server/models/user/user' import { MVideoFullLight } from '@server/types/models' import { VideoFileImportPayload } from '@shared/models' @@ -72,7 +72,7 @@ async function updateVideoFile (video: MVideoFullLight, inputFilePath: string) { const newVideoFile = new VideoFileModel({ resolution: videoFileResolution, extname: fileExt, - filename: generateVideoFilename(video, false, videoFileResolution, fileExt), + filename: generateWebTorrentVideoFilename(videoFileResolution, fileExt), size, fps, videoId: video.id diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index 55498003d..6e425d09c 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts @@ -8,7 +8,7 @@ import { Hooks } from '@server/lib/plugins/hooks' import { ServerConfigManager } from '@server/lib/server-config-manager' import { isAbleToUploadVideo } from '@server/lib/user' import { addOptimizeOrMergeAudioJob } from '@server/lib/video' -import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' +import { generateWebTorrentVideoFilename, getVideoFilePath } from '@server/lib/video-paths' import { ThumbnailModel } from '@server/models/video/thumbnail' import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import' import { @@ -124,7 +124,7 @@ async function processFile (downloader: () => Promise, videoImport: MVid extname: fileExt, resolution: videoFileResolution, size: stats.size, - filename: generateVideoFilename(videoImport.Video, false, videoFileResolution, fileExt), + filename: generateWebTorrentVideoFilename(videoFileResolution, fileExt), fps, videoId: videoImport.videoId } -- cgit v1.2.3