diff options
Diffstat (limited to 'server/lib/job-queue/handlers/video-import.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-import.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index 0d00c1b9d..8fa024105 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -6,7 +6,7 @@ import { isPostImportVideoAccepted } from '@server/lib/moderation' | |||
6 | import { Hooks } from '@server/lib/plugins/hooks' | 6 | import { Hooks } from '@server/lib/plugins/hooks' |
7 | import { isAbleToUploadVideo } from '@server/lib/user' | 7 | import { isAbleToUploadVideo } from '@server/lib/user' |
8 | import { addOptimizeOrMergeAudioJob } from '@server/lib/video' | 8 | import { addOptimizeOrMergeAudioJob } from '@server/lib/video' |
9 | import { getVideoFilePath } from '@server/lib/video-paths' | 9 | import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' |
10 | import { ThumbnailModel } from '@server/models/video/thumbnail' | 10 | import { ThumbnailModel } from '@server/models/video/thumbnail' |
11 | import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import' | 11 | import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import' |
12 | import { | 12 | import { |
@@ -116,10 +116,12 @@ async function processFile (downloader: () => Promise<string>, videoImport: MVid | |||
116 | const duration = await getDurationFromVideoFile(tempVideoPath) | 116 | const duration = await getDurationFromVideoFile(tempVideoPath) |
117 | 117 | ||
118 | // Prepare video file object for creation in database | 118 | // Prepare video file object for creation in database |
119 | const fileExt = extname(tempVideoPath) | ||
119 | const videoFileData = { | 120 | const videoFileData = { |
120 | extname: extname(tempVideoPath), | 121 | extname: fileExt, |
121 | resolution: videoFileResolution, | 122 | resolution: videoFileResolution, |
122 | size: stats.size, | 123 | size: stats.size, |
124 | filename: generateVideoFilename(videoImport.Video, false, videoFileResolution, fileExt), | ||
123 | fps, | 125 | fps, |
124 | videoId: videoImport.videoId | 126 | videoId: videoImport.videoId |
125 | } | 127 | } |
@@ -183,7 +185,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: MVid | |||
183 | } | 185 | } |
184 | 186 | ||
185 | // Create torrent | 187 | // Create torrent |
186 | await createTorrentAndSetInfoHash(videoImportWithFiles.Video, videoFile) | 188 | await createTorrentAndSetInfoHash(videoImportWithFiles.Video, videoImportWithFiles.Video, videoFile) |
187 | 189 | ||
188 | const videoFileSave = videoFile.toJSON() | 190 | const videoFileSave = videoFile.toJSON() |
189 | 191 | ||