diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-27 15:57:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-27 15:57:43 +0100 |
commit | 056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1 (patch) | |
tree | bf59c7f52be7da2d6bfd7ee18814b9c7f8463966 /server/controllers/api | |
parent | 6fdc553adb23db216b44e425a85ea76bdf0a2a40 (diff) | |
download | PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.gz PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.zst PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.zip |
Fix resolution for portrait videos
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/videos/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index c3d3acd26..10b309cd1 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -3,7 +3,7 @@ import { extname, join } from 'path' | |||
3 | import { VideoCreate, VideoPrivacy, VideoUpdate } from '../../../../shared' | 3 | import { VideoCreate, VideoPrivacy, VideoUpdate } from '../../../../shared' |
4 | import { renamePromise } from '../../../helpers/core-utils' | 4 | import { renamePromise } from '../../../helpers/core-utils' |
5 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 5 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
6 | import { getVideoFileHeight } from '../../../helpers/ffmpeg-utils' | 6 | import { getVideoFileResolution } from '../../../helpers/ffmpeg-utils' |
7 | import { processImage } from '../../../helpers/image-utils' | 7 | import { processImage } from '../../../helpers/image-utils' |
8 | import { logger } from '../../../helpers/logger' | 8 | import { logger } from '../../../helpers/logger' |
9 | import { createReqFiles, getFormattedObjects, getServerActor, resetSequelizeInstance } from '../../../helpers/utils' | 9 | import { createReqFiles, getFormattedObjects, getServerActor, resetSequelizeInstance } from '../../../helpers/utils' |
@@ -187,11 +187,11 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi | |||
187 | const video = new VideoModel(videoData) | 187 | const video = new VideoModel(videoData) |
188 | video.url = getVideoActivityPubUrl(video) | 188 | video.url = getVideoActivityPubUrl(video) |
189 | 189 | ||
190 | const videoFileHeight = await getVideoFileHeight(videoPhysicalFile.path) | 190 | const { videoFileResolution } = await getVideoFileResolution(videoPhysicalFile.path) |
191 | 191 | ||
192 | const videoFileData = { | 192 | const videoFileData = { |
193 | extname: extname(videoPhysicalFile.filename), | 193 | extname: extname(videoPhysicalFile.filename), |
194 | resolution: videoFileHeight, | 194 | resolution: videoFileResolution, |
195 | size: videoPhysicalFile.size | 195 | size: videoPhysicalFile.size |
196 | } | 196 | } |
197 | const videoFile = new VideoFileModel(videoFileData) | 197 | const videoFile = new VideoFileModel(videoFileData) |