diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/index.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 14c969ec3..2b7ead954 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -37,10 +37,11 @@ import { | |||
37 | retryTransactionWrapper, | 37 | retryTransactionWrapper, |
38 | generateRandomString, | 38 | generateRandomString, |
39 | getFormattedObjects, | 39 | getFormattedObjects, |
40 | renamePromise | 40 | renamePromise, |
41 | getVideoFileHeight | ||
41 | } from '../../../helpers' | 42 | } from '../../../helpers' |
42 | import { TagInstance, VideoInstance } from '../../../models' | 43 | import { TagInstance, VideoInstance } from '../../../models' |
43 | import { VideoCreate, VideoUpdate, VideoResolution } from '../../../../shared' | 44 | import { VideoCreate, VideoUpdate } from '../../../../shared' |
44 | 45 | ||
45 | import { abuseVideoRouter } from './abuse' | 46 | import { abuseVideoRouter } from './abuse' |
46 | import { blacklistRouter } from './blacklist' | 47 | import { blacklistRouter } from './blacklist' |
@@ -192,9 +193,14 @@ function addVideo (req: express.Request, res: express.Response, videoPhysicalFil | |||
192 | return { author, tagInstances, video } | 193 | return { author, tagInstances, video } |
193 | }) | 194 | }) |
194 | .then(({ author, tagInstances, video }) => { | 195 | .then(({ author, tagInstances, video }) => { |
196 | const videoFilePath = join(CONFIG.STORAGE.VIDEOS_DIR, videoPhysicalFile.filename) | ||
197 | return getVideoFileHeight(videoFilePath) | ||
198 | .then(height => ({ author, tagInstances, video, videoFileHeight: height })) | ||
199 | }) | ||
200 | .then(({ author, tagInstances, video, videoFileHeight }) => { | ||
195 | const videoFileData = { | 201 | const videoFileData = { |
196 | extname: extname(videoPhysicalFile.filename), | 202 | extname: extname(videoPhysicalFile.filename), |
197 | resolution: VideoResolution.ORIGINAL, | 203 | resolution: videoFileHeight, |
198 | size: videoPhysicalFile.size | 204 | size: videoPhysicalFile.size |
199 | } | 205 | } |
200 | 206 | ||