aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r--server/lib/job-queue/handlers/video-import.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index 28a03d19e..2d19b82a4 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -114,8 +114,8 @@ 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) 117 const stats = await statPromise(tempVideoPath)
118 const isAble = await videoImport.User.isAbleToUploadVideo({ size }) 118 const isAble = await videoImport.User.isAbleToUploadVideo({ size: stats.size })
119 if (isAble === false) { 119 if (isAble === false) {
120 throw new Error('The user video quota is exceeded with this video to import.') 120 throw new Error('The user video quota is exceeded with this video to import.')
121 } 121 }
@@ -128,7 +128,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide
128 const videoFileData = { 128 const videoFileData = {
129 extname: extname(tempVideoPath), 129 extname: extname(tempVideoPath),
130 resolution: videoFileResolution, 130 resolution: videoFileResolution,
131 size, 131 size: stats.size,
132 fps, 132 fps,
133 videoId: videoImport.videoId 133 videoId: videoImport.videoId
134 } 134 }
@@ -209,7 +209,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide
209 209
210 } catch (err) { 210 } catch (err) {
211 try { 211 try {
212 if (tempVideoPath) await unlinkPromise(tempVideoPath) 212 // if (tempVideoPath) await unlinkPromise(tempVideoPath)
213 } catch (errUnlink) { 213 } catch (errUnlink) {
214 logger.warn('Cannot cleanup files after a video import error.', { err: errUnlink }) 214 logger.warn('Cannot cleanup files after a video import error.', { err: errUnlink })
215 } 215 }