aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/services.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-27 16:12:41 +0200
committerChocobozzz <me@florianbigard.com>2021-05-27 16:12:41 +0200
commit8f608a4cb22ab232cfab20665050764b38bac9c7 (patch)
tree6a6785aae79bf5939ad7b7a50a1bd8031268d2b4 /server/controllers/services.ts
parent030ccfce59a8cb8f2fee6ea8dd363ba635c5c5c2 (diff)
parentc215e627b575d2c4085ccb222f4ca8d0237b7552 (diff)
downloadPeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.tar.gz
PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.tar.zst
PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.zip
Merge branch 'develop' into shorter-URLs-channels-accounts
Diffstat (limited to 'server/controllers/services.ts')
-rw-r--r--server/controllers/services.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/services.ts b/server/controllers/services.ts
index 189e1651b..8c0af9ff7 100644
--- a/server/controllers/services.ts
+++ b/server/controllers/services.ts
@@ -78,17 +78,18 @@ function buildOEmbed (options: {
78 const maxWidth = parseInt(req.query.maxwidth, 10) 78 const maxWidth = parseInt(req.query.maxwidth, 10)
79 79
80 const embedUrl = webserverUrl + embedPath 80 const embedUrl = webserverUrl + embedPath
81 let embedWidth = EMBED_SIZE.width
82 let embedHeight = EMBED_SIZE.height
83 const embedTitle = escapeHTML(title) 81 const embedTitle = escapeHTML(title)
84 82
85 let thumbnailUrl = previewPath 83 let thumbnailUrl = previewPath
86 ? webserverUrl + previewPath 84 ? webserverUrl + previewPath
87 : undefined 85 : undefined
88 86
89 if (maxHeight < embedHeight) embedHeight = maxHeight 87 let embedWidth = EMBED_SIZE.width
90 if (maxWidth < embedWidth) embedWidth = maxWidth 88 if (maxWidth < embedWidth) embedWidth = maxWidth
91 89
90 let embedHeight = EMBED_SIZE.height
91 if (maxHeight < embedHeight) embedHeight = maxHeight
92
92 // Our thumbnail is too big for the consumer 93 // Our thumbnail is too big for the consumer
93 if ( 94 if (
94 (maxHeight !== undefined && maxHeight < previewSize.height) || 95 (maxHeight !== undefined && maxHeight < previewSize.height) ||