aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-17 11:24:36 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit965c4b22d0e4d2f853501e844e6ebbb861bd389d (patch)
tree519574c83ea070968d9561d493bc16ac2e285090 /server/lib
parent06a05d5f4784a7cbb27aa1188385b5679845dad8 (diff)
downloadPeerTube-965c4b22d0e4d2f853501e844e6ebbb861bd389d.tar.gz
PeerTube-965c4b22d0e4d2f853501e844e6ebbb861bd389d.tar.zst
PeerTube-965c4b22d0e4d2f853501e844e6ebbb861bd389d.zip
Use height instead of width to represent the video resolution
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index e2f46bd02..d1888556c 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -11,7 +11,7 @@ import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos
11import { retryTransactionWrapper } from '../../helpers/database-utils' 11import { retryTransactionWrapper } from '../../helpers/database-utils'
12import { logger } from '../../helpers/logger' 12import { logger } from '../../helpers/logger'
13import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' 13import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests'
14import { ACTIVITY_PUB, CONFIG, REMOTE_SCHEME, sequelizeTypescript, STATIC_PATHS, VIDEO_MIMETYPE_EXT } from '../../initializers' 14import { ACTIVITY_PUB, CONFIG, REMOTE_SCHEME, sequelizeTypescript, VIDEO_MIMETYPE_EXT } from '../../initializers'
15import { AccountVideoRateModel } from '../../models/account/account-video-rate' 15import { AccountVideoRateModel } from '../../models/account/account-video-rate'
16import { ActorModel } from '../../models/activitypub/actor' 16import { ActorModel } from '../../models/activitypub/actor'
17import { TagModel } from '../../models/video/tag' 17import { TagModel } from '../../models/video/tag'
@@ -147,7 +147,7 @@ function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObje
147 for (const fileUrl of fileUrls) { 147 for (const fileUrl of fileUrls) {
148 // Fetch associated magnet uri 148 // Fetch associated magnet uri
149 const magnet = videoObject.url.find(u => { 149 const magnet = videoObject.url.find(u => {
150 return u.mimeType === 'application/x-bittorrent;x-scheme-handler/magnet' && u.width === fileUrl.width 150 return u.mimeType === 'application/x-bittorrent;x-scheme-handler/magnet' && u.height === fileUrl.height
151 }) 151 })
152 152
153 if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href) 153 if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href)
@@ -160,7 +160,7 @@ function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObje
160 const attribute = { 160 const attribute = {
161 extname: VIDEO_MIMETYPE_EXT[ fileUrl.mimeType ], 161 extname: VIDEO_MIMETYPE_EXT[ fileUrl.mimeType ],
162 infoHash: parsed.infoHash, 162 infoHash: parsed.infoHash,
163 resolution: fileUrl.width, 163 resolution: fileUrl.height,
164 size: fileUrl.size, 164 size: fileUrl.size,
165 videoId: videoCreated.id, 165 videoId: videoCreated.id,
166 fps: fileUrl.fps 166 fps: fileUrl.fps