aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-07 15:17:17 +0200
committerChocobozzz <me@florianbigard.com>2018-08-08 09:30:31 +0200
commit3e17515e2996b79e23f569c296051a91af3fcbe4 (patch)
treed1c06c394a9f4b1d8646625612c2d5d3e02e9191 /server/lib
parent187501f8b8e334f043ae1e9af3c9d4f45ea0e6c1 (diff)
downloadPeerTube-3e17515e2996b79e23f569c296051a91af3fcbe4.tar.gz
PeerTube-3e17515e2996b79e23f569c296051a91af3fcbe4.tar.zst
PeerTube-3e17515e2996b79e23f569c296051a91af3fcbe4.zip
Add torrent tests
Diffstat (limited to 'server/lib')
-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 }