aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-07 10:07:53 +0200
committerChocobozzz <me@florianbigard.com>2018-08-08 09:30:31 +0200
commita84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4 (patch)
treecf2feafcfadb5b6e9784c86d67e692db8d599b7d /server/lib/job-queue
parent990b6a0b0c4fbebc165e5cf7cec8fbc1cbaa6c66 (diff)
downloadPeerTube-a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4.tar.gz
PeerTube-a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4.tar.zst
PeerTube-a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4.zip
Add import.video.torrent configuration
Diffstat (limited to 'server/lib/job-queue')
-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 }