]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/video-file-import.ts
Fix video upload with a capitalized ext
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / video-file-import.ts
index 8297a15716819c5fba66efeb3ef7d2be5f0f8f17..048963033a9bf0de137b618a16ac410c3860a31b 100644 (file)
@@ -1,6 +1,7 @@
 import * as Bull from 'bull'
 import { copy, stat } from 'fs-extra'
 import { extname } from 'path'
+import { getLowercaseExtension } from '@server/helpers/core-utils'
 import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
 import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths'
 import { UserModel } from '@server/models/user/user'
@@ -55,7 +56,7 @@ async function updateVideoFile (video: MVideoFullLight, inputFilePath: string) {
   const { size } = await stat(inputFilePath)
   const fps = await getVideoFileFPS(inputFilePath)
 
-  const fileExt = extname(inputFilePath)
+  const fileExt = getLowercaseExtension(inputFilePath)
 
   const currentVideoFile = video.VideoFiles.find(videoFile => videoFile.resolution === videoFileResolution)