aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-import.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue/handlers/video-import.ts')
-rw-r--r--server/lib/job-queue/handlers/video-import.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index fd61aecad..28a03d19e 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -114,16 +114,21 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide
114 tempVideoPath = await downloader() 114 tempVideoPath = await downloader()
115 115
116 // Get information about this video 116 // Get information about this video
117 const { size } = await statPromise(tempVideoPath)
118 const isAble = await videoImport.User.isAbleToUploadVideo({ size })
119 if (isAble === false) {
120 throw new Error('The user video quota is exceeded with this video to import.')
121 }
122
117 const { videoFileResolution } = await getVideoFileResolution(tempVideoPath) 123 const { videoFileResolution } = await getVideoFileResolution(tempVideoPath)
118 const fps = await getVideoFileFPS(tempVideoPath) 124 const fps = await getVideoFileFPS(tempVideoPath)
119 const stats = await statPromise(tempVideoPath)
120 const duration = await getDurationFromVideoFile(tempVideoPath) 125 const duration = await getDurationFromVideoFile(tempVideoPath)
121 126
122 // Create video file object in database 127 // Create video file object in database
123 const videoFileData = { 128 const videoFileData = {
124 extname: extname(tempVideoPath), 129 extname: extname(tempVideoPath),
125 resolution: videoFileResolution, 130 resolution: videoFileResolution,
126 size: stats.size, 131 size,
127 fps, 132 fps,
128 videoId: videoImport.videoId 133 videoId: videoImport.videoId
129 } 134 }